pg_recvlogical prints bogus error when interrupted
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: pgsql-hackers@postgresql.org
Date: 2022-10-19T21:39:53Z
Lists: pgsql-hackers
Hi, While reviewing https://postgr.es/m/CAD21AoBe2o2D%3Dxyycsxw2bQOD%3DzPj7ETuJ5VYGN%3DdpoTiCMRJQ%40mail.gmail.com I noticed that pg_recvlogical prints "pg_recvlogical: error: unexpected termination of replication stream: " when signalled with SIGINT/TERM. Oddly enough, that looks to have "always" been the case, even though clearly the code tried to make provisions for a different outcome. It looks to me like all that's needed is to gate the block printing the message with an !time_to_abort. I also then noticed that we don't fsync the output file in cases of errors - that seems wrong to me? Looks to me like that block should be moved till after the error:? Greetings, Andres Freund
Commits
-
Fix pg_recvlogical upon signal termination
- 47556a0013fa 17.0 landed