{"record":{"id":"9e2ce4f1238a4ab6","repo":"neondatabase/neon","slug":"failed-to-get-list-of-autovacuum-workers","errorCode":null,"errorMessage":"failed to get list of autovacuum workers: {}","messagePattern":"failed to get list of autovacuum workers: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compute_tools/src/monitor.rs","lineNumber":342,"sourceCode":"        const AUTOVACUUM_COUNT_QUERY: &str =\n            \"select count(*) from pg_stat_activity where backend_type = 'autovacuum worker'\";\n        match cli.query_one(AUTOVACUUM_COUNT_QUERY, &[]) {\n            Ok(r) => match r.try_get::<&str, i64>(\"count\") {\n                Ok(num_workers) => {\n                    if num_workers > 0 {\n                        self.last_active = Some(Utc::now());\n                        return Ok(());\n                    };\n                }\n                Err(e) => {\n                    return Err(anyhow::anyhow!(\n                        \"failed to parse autovacuum workers count: {}\",\n                        e\n                    ));\n                }\n            },\n            Err(e) => {\n                return Err(anyhow::anyhow!(\n                    \"failed to get list of autovacuum workers: {}\",\n                    e\n                ));\n            }\n        }\n\n        Ok(())\n    }\n}\n\n// Hang on condition variable waiting until the compute status is `Running`.\nfn wait_for_postgres_start(compute: &ComputeNode) {\n    let mut state = compute.state.lock().unwrap();\n    let pg_init_timeout = compute\n        .params\n        .pg_init_timeout\n        .unwrap_or(PG_DEFAULT_INIT_TIMEOUIT);\n","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/neondatabase/neon/blob/8f60b04da47ffefe0e52bda2440134b42874eb75/compute_tools/src/monitor.rs#L324-L360","documentation":"check() counts autovacuum workers via pg_stat_activity (backend_type = 'autovacuum worker') so a running autovacuum prevents compute suspension. This error means query_one itself failed - the connection broke, the statement timed out, or the server errored. Like other check() failures it results in report_down() and a reconnect attempt on the next monitor tick.","triggerScenarios":"cli.query_one on pg_stat_activity returns Err: dropped connection, statement_timeout, Postgres restart, or server error while catalog stats are churned by heavy autovacuum activity.","commonSituations":"Busy computes with aggressive autovacuum where stats lookups contend; monitor polls racing Postgres shutdown; flaky connections between compute_ctl and Postgres.","solutions":["Check the nested error for the underlying cause/SQLSTATE","Single failures self-heal via the monitor reconnect; watch for streaks","Verify Postgres is healthy and pg_stat_activity is queryable","Reduce extreme catalog pressure (autovacuum tuning) if timeouts recur"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match cli.query_one(AUTOVACUUM_COUNT_QUERY, &[]) {\n    Ok(r) => { /* parse count, keep alive if > 0 */ }\n    Err(e) => { error!(\"failed to get list of autovacuum workers: {e}\"); client = conf.connect(NoTls); }\n}","preventionTips":["Retry transient failures on the next monitor tick","Check Postgres health when errors repeat every 500ms","Keep autovacuum/catalog pressure within timeout budgets"],"tags":["postgres","pg-stat-activity","autovacuum","rust","connection"],"backgroundTag":"postgres-query-failed","analyzedSha":"8f60b04da47ffefe0e52bda2440134b42874eb75","analyzedAt":"2026-08-16T23:39:28.135Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}