{"record":{"id":"f80d3edfb8581019","repo":"apache/seatunnel","slug":"poll-failed","errorCode":"POLL_FAILED","errorMessage":"Failed to poll SNMP agent {host}:{port}","messagePattern":"Failed to poll SNMP agent (.+?):(.+?)","errorType":"error_code","errorClass":"SnmpConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/source/SnmpSourceReader.java","lineNumber":109,"sourceCode":"        }\n\n        if (Boundedness.UNBOUNDED.equals(context.getBoundedness())) {\n            long waitMillis = nextPollTimeMillis - currentTimeMillis.getAsLong();\n            if (waitMillis > 0) {\n                Thread.sleep(Math.min(waitMillis, MAX_IDLE_WAIT_MILLIS));\n                return;\n            }\n        }\n\n        long pollTime = currentTimeMillis.getAsLong();\n        List<SnmpRecord> records;\n        try {\n            records = client.get(config.getOids());\n        } catch (IOException e) {\n            if (closed) {\n                return;\n            }\n            throw new SnmpConnectorException(\n                    SnmpConnectorErrorCode.POLL_FAILED,\n                    \"Failed to poll SNMP agent \" + config.getHost() + \":\" + config.getPort(),\n                    e);\n        }\n\n        if (closed) {\n            return;\n        }\n        synchronized (output.getCheckpointLock()) {\n            for (SnmpRecord record : records) {\n                output.collect(\n                        new SeaTunnelRow(\n                                new Object[] {\n                                    config.getHost() + \":\" + config.getPort(),\n                                    record.getOid(),\n                                    record.getValue(),\n                                    record.getValueType(),\n                                    pollTime","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-snmp/src/main/java/org/apache/seatunnel/connectors/seatunnel/snmp/source/SnmpSourceReader.java#L91-L127","documentation":"SnmpSourceReader.pollNext() polls the agent via client.get(config.getOids()); an IOException there becomes SnmpConnectorException with POLL_FAILED. If the reader is already closed, the IOException is swallowed (return) instead of throwing — so this error only surfaces on a live reader whose poll failed (timeout, agent error).","triggerScenarios":"Calling pollNext() on a non-closed SnmpSourceReader when client.get() throws IOException — SNMP GET timeout (2415) or agent error status (2416). Exceptions during close-triggered polls are suppressed.","commonSituations":"Agent rebooted or network partition mid-streaming job; intermittent packet loss between worker and agent; polling interval tighter than agent response time causing stress; wrong community after agent reconfiguration.","solutions":["Check the wrapped cause to distinguish timeout from agent error status, then apply the matching fix (connectivity vs OID/ACL).","Increase the SNMP timeout/retries so transient loss does not fail the poll.","Enable source-level retry/resume via checkpointing so the job recovers after agent blips.","Confirm the agent's uptime/availability over the job's duration (monitoring, snmpd logs).","Review config.getOids() validity if the wrapped error is an agent error status."],"exampleFix":"// before\npollInterval = 1000ms, snmp timeout = 500ms, retries = 0\n// after\npollInterval = 5000ms, snmp timeout = 3000ms, retries = 2","handlingStrategy":"retry","validationCode":"// health probe before starting a long-running poll loop\nsnmpCli(\"snmpget -v2c -c \" + community + \" -t 3 -r 2 \" + host + \" \" + oids.get(0));","typeGuard":null,"tryCatchPattern":"try {\n    reader.pollNext();\n} catch (SnmpConnectorException e) {\n    if (e.getCode() == SnmpConnectorErrorCode.POLL_FAILED && isTransient(e.getCause())) {\n        scheduleRecoveryWithBackoff();\n    } else throw e;\n}","preventionTips":["Set poll interval comfortably larger than SNMP timeout + retries.","Enable checkpointing so the source recovers after agent restarts.","Monitor agent availability (snmpd logs, uptime checks) for the job window.","Keep OID configuration stable — agent-side MIB changes cause poll failures mid-job."],"tags":["snmp","polling","source","streaming"],"backgroundTag":"request-timeout","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}