Hi Jim! Thanks for your review and rebase! > Since the message's size is limited to BACKEND_MSG_MAX_LEN, shouldn't > you use it to limit msg at pg_terminate_backend[_msg]()? Something like: >
The message is truncated inside BackendMsgSet function, so I see a little point in truncating it at pg_terminate_backend.. Also, changing the stpncpy() to strlcpy() breaks the logic of returning result length of the message and NOTICE message about it, so I reverted this change. But this note make me think about adding test to truncation logic, so I added it in v4. -- Best regards, Roman Khapov
v4-0001-message-in-pg_terminate_backend-and-pg_cancel_bac.patch
Description: Binary data
