Unexpected message truncation in WaitForAllTransactionsToFinish

Started by cca550719 days ago2 messageshackers
Jump to latest
#1cca5507
cca5507@qq.com

Hi,

In WaitForAllTransactionsToFinish():

```
char activity[64];
int rc;

/* Oldest running xid is older than us, so wait */
snprintf(activity,
sizeof(activity),
"Waiting for current transactions to finish (waiting for %u)",
waitforxid);
pgstat_report_activity(STATE_RUNNING, activity);
```

The buffer is not big enough to hold the message if the 'waitforxid' is too big.

How about changing the message to this:

"Waiting for transactions older than %u to finish"

--
Regards,
ChangAo Chen

#2Daniel Gustafsson
daniel@yesql.se
In reply to: cca5507 (#1)
Re: Unexpected message truncation in WaitForAllTransactionsToFinish

On 5 Jun 2026, at 10:30, cca5507 <cca5507@qq.com> wrote:

The buffer is not big enough to hold the message if the 'waitforxid' is too big.

Nice catch, will fix.

--
Daniel Gustafsson