Activity: IoWorkerMain
Waiting in main loop of IO Worker process
PostgreSQL wait event dossier
ClassActivity
Event
IoWorkerMain
VersionsPG 18
Evidence2 source location(s)
Official description
Waiting in main loop of IO Worker process
| PG 13 | PG 14 | PG 15 | PG 16 | PG 17 | PG 18 |
|---|---|---|---|---|---|
| — | — | — | — | — | ✓ |
Trigger mechanism
WAIT_EVENT_IO_WORKER_MAIN at src/backend/storage/aio/method_worker.c:573 is the grep-verified reporting path. The public identity/resource is mapped at src/backend/utils/activity/wait_event_names.txt:60. The instrumented operation is: Waiting in main loop of IO Worker process. The IoWorkerMain background path reports this event around its latch wait when its main loop has no immediate work. A signal, timeout, or new work clears the sleep and the process loops again.
Normal or trouble?
- Normal: This is normally expected idleness for the matching background process.
- Investigate: Investigate only when queued work or a shutdown/failover deadline is not advancing while the process remains here, or when the event appears on an unexpected backend type.
Diagnostic SQL
Sessions waiting on Activity/IoWorkerMain
Current Activity cohort
Lock and relation context for these sessions
Response
- Match the row to backend_type.
- Inspect the process-specific backlog and last-progress timestamp.
- Fix the missing work signal or stalled upstream phase; do not kill a normally idle worker.
Source evidence
- PostgreSQL 18.6 · src/backend/storage/aio/method_worker.c:573 —
WAIT_EVENT_IO_WORKER_MAIN - PostgreSQL 18.6 · src/backend/utils/activity/wait_event_names.txt:60 —
IO_WORKER_MAIN
Related controls and signals
- GUCs: None directly.
- Metrics: [metric:waiting_sessions] · [metric:wait_event_share]