aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/jsonb.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2023-07-20 10:22:46 +0900
committerMichael Paquier <michael@paquier.xyz>2023-07-20 10:22:46 +0900
commit47556a0013fa64d44add2760577d49cf2eca4cd0 (patch)
tree988ea4f510d4153ba701b32efea43e48cfe150ee /src/backend/utils/adt/jsonb.c
parentab29a7a9c6ffaddaf6788a13e83f1a249f06bb1b (diff)
downloadpostgresql-47556a0013fa64d44add2760577d49cf2eca4cd0.tar.gz
postgresql-47556a0013fa64d44add2760577d49cf2eca4cd0.zip
Fix pg_recvlogical upon signal termination
When pg_recvlogical needs to abort on a signal like SIGINT/SIGTERM, it is expected to exit cleanly as the code documents. However, the code forgot to clean up the state of the connection before leaving. This would cause the tool to emit messages like "unexpected termination of replication stream" error, which is meant for really unexpected termination or a crash. The code is refactored to apply the same termination abort operations for signals, end LSN and keepalive cases, registering a "reason" for the termination with a message printed under --verbose adapted to the reason used. This is arguably a bug, but this has been this way since the tool exists and the signal termination can now become slower depending on the change being decoded when the signal is received. Reported-by: Andres Freund Author: Bharath Rupireddy Reviewed-by: Andres Freund, Kyotaro Horiguchi, Cary Huang, Michael Paquier Discussion: https://postgr.es/m/20221019213953.htdtzikf4f45ywil@awork3.anarazel.de
Diffstat (limited to 'src/backend/utils/adt/jsonb.c')
0 files changed, 0 insertions, 0 deletions