{"record":{"id":"169dd1a2eeb2a9a6","repo":"apache/seatunnel","slug":"input-multiline-flush-idle-timeout-ms-must-be-0","errorCode":null,"errorMessage":"input.multiline.flush-idle-timeout-ms must be > 0 when multiline is enabled, otherwise the buffer may never flush (input id=${id}).","messagePattern":"input\\.multiline\\.flush-idle-timeout-ms must be > 0 when multiline is enabled, otherwise the buffer may never flush \\(input id=(.+?)\\)\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java","lineNumber":93,"sourceCode":"                config.getOptional(FileCollectOptions.MULTILINE_PATTERN).orElse(null);\n        this.multilineMatch = config.get(FileCollectOptions.MULTILINE_MATCH);\n        validateMultilineMatch(this.multilineMatch);\n        this.multilineNegate = config.get(FileCollectOptions.MULTILINE_NEGATE);\n        this.multilineMaxLines = config.get(FileCollectOptions.MULTILINE_MAX_LINES);\n        if (this.multilineMaxLines < 1) {\n            throw new IllegalArgumentException(\n                    \"input.multiline.max-lines must be >= 1 when set (input id=\" + this.id + \").\");\n        }\n        this.multilineFlushIdleTimeoutMs =\n                config.get(FileCollectOptions.MULTILINE_FLUSH_IDLE_TIMEOUT_MS);\n        if (this.multilineFlushIdleTimeoutMs < 0L) {\n            throw new IllegalArgumentException(\n                    \"input.multiline.flush-idle-timeout-ms must not be negative (input id=\"\n                            + this.id\n                            + \").\");\n        }\n        if (isMultilineEnabled() && this.multilineFlushIdleTimeoutMs <= 0L) {\n            throw new IllegalArgumentException(\n                    \"input.multiline.flush-idle-timeout-ms must be > 0 when multiline is enabled,\"\n                            + \" otherwise the buffer may never flush (input id=\"\n                            + this.id\n                            + \").\");\n        }\n        this.outputType = config.get(FileCollectOptions.OUTPUT_FORMAT_TYPE);\n        validateOutputType(this.outputType);\n        this.onError = config.get(FileCollectOptions.ON_ERROR);\n        validateOnError(this.onError);\n        this.globScanIntervalMs = config.get(FileCollectOptions.GLOB_SCAN_INTERVAL_MS);\n        if (this.globScanIntervalMs < 1L) {\n            throw new IllegalArgumentException(\n                    \"input.glob-scan-interval-ms must be >= 1 when set (input id=\"\n                            + this.id\n                            + \").\");\n        }\n        this.closeInactiveMs = config.get(FileCollectOptions.CLOSE_INACTIVE_MS);\n        if (this.closeInactiveMs < 0L) {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-connector/src/main/java/org/apache/seatunnel/edge/agent/connector/config/FileCollectConfig.java#L75-L111","documentation":"When multiline aggregation is enabled, a flush idle timeout of 0 or less means an unterminated multiline buffer may never be flushed. FileCollectConfig enforces a strictly positive timeout in that case and throws this IllegalArgumentException.","triggerScenarios":"Enabling multiline (multiline.pattern or multiline.match set) while input.multiline.flush-idle-timeout-ms is 0 or omitted-but-resolves-to-0.","commonSituations":"Users set the timeout to 0 thinking it means 'flush immediately', not realizing it means 'never flush' when multiline is active.","solutions":["Set input.multiline.flush-idle-timeout-ms to a positive value, e.g. 5000-60000","Disable multiline aggregation if line-by-line parsing is intended","Keep the timeout >0 whenever multiline.pattern/multiline.match are configured"],"exampleFix":"# before\nmultiline.pattern = \"^[0-9]{4}-\"\nmultiline.match = \"after\"\nmultiline.flush-idle-timeout-ms = 0\n# after\nmultiline.pattern = \"^[0-9]{4}-\"\nmultiline.match = \"after\"\nmultiline.flush-idle-timeout-ms = 10000","handlingStrategy":"validation","validationCode":"boolean multilineEnabled = cfg.contains(FileCollectOptions.MULTILINE_PATTERN) || cfg.contains(FileCollectOptions.MULTILINE_MATCH);\nLong t = cfg.getOptional(FileCollectOptions.MULTILINE_FLUSH_IDLE_TIMEOUT_MS).orElse(null);\nif (multilineEnabled && t != null && t <= 0L) { throw new IllegalArgumentException(\"flush-idle-timeout-ms must be > 0 when multiline enabled\"); }","typeGuard":null,"tryCatchPattern":"try { FileCollectConfig.from(config); } catch (IllegalArgumentException e) { log.error(\"Multiline config invalid: {}\", e.getMessage()); }","preventionTips":["Whenever multiline.pattern is set, also set a positive flush-idle-timeout-ms","Treat 0 as 'never flush', not 'flush now'","Test multiline configs with an unterminated final record"],"tags":["config","validation","multiline"],"backgroundTag":"conflicting-config-options","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"}