Commit 9ec6e12
committed
fix: report worker activity to pg_stat_activity
Background workers must call pgstat_report_activity() themselves to
update state/state_change in pg_stat_activity; regular user backends
get this for free via tcop/postgres.c. Without it the pg_net worker
shows up with a blank state column, making it impossible to tell
from monitoring whether the worker is idle, processing a tick, or
stuck in a transaction. Adds STATE_IDLE / STATE_RUNNING transitions
around the inner work loop.
cmd_str is NULL, matching what other background workers (e.g.
logical replication apply worker) do; backend_type already
identifies it as "pg_net <ver> worker" so a query-column label
would be redundant.1 parent feaef76 commit 9ec6e12
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
268 | 271 | | |
269 | 272 | | |
270 | 273 | | |
| |||
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| 280 | + | |
| 281 | + | |
277 | 282 | | |
278 | 283 | | |
279 | 284 | | |
| |||
388 | 393 | | |
389 | 394 | | |
390 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
391 | 399 | | |
392 | 400 | | |
393 | 401 | | |
| |||
0 commit comments