Re: Additional message in pg_terminate_backend

From: Roman Khapov <rkhapov(at)yandex-team(dot)ru>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Kirill Reshke <reshkekirill(at)gmail(dot)com>, Daniel Gustafsson <daniel(at)yesql(dot)se>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Additional message in pg_terminate_backend
Date: 2026-02-03 07:52:57
Message-ID: AE8B7287-51F4-498D-8466-183EC582634B@yandex-team.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v4-0001-message-in-pg_terminate_backend-and-pg_cancel_bac.patch application/octet-stream 18.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-02-03 08:09:17 Re: rename and move AssertVariableIsOfType
Previous Message Imran Zaheer 2026-02-03 07:25:39 Re: [WIP] Pipelined Recovery