{"record":{"id":"4d99c27b940fcd49","repo":"apache/seatunnel","slug":"stain-trace-max-traces-per-second-per-worker-mu","errorCode":null,"errorMessage":"${STAIN_TRACE_MAX_TRACES_PER_SECOND_PER_WORKER} must be >= 0","messagePattern":"(.+?) must be >= 0","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/config/EngineConfig.java","lineNumber":242,"sourceCode":"\n    public void setTimerFlushPoolSize(int timerFlushPoolSize) {\n        checkPositive(\n                timerFlushPoolSize,\n                ServerConfigOptions.WorkerServerConfigOptions.TIMER_FLUSH_POOL_SIZE.key()\n                        + \" must be > 0\");\n        this.timerFlushPoolSize = timerFlushPoolSize;\n    }\n\n    public void setStainTraceSampleRate(int stainTraceSampleRate) {\n        checkPositive(\n                stainTraceSampleRate, ServerConfigOptions.STAIN_TRACE_SAMPLE_RATE + \" must be > 0\");\n        this.stainTraceSampleRate = stainTraceSampleRate;\n    }\n\n    public void setStainTraceMaxTracesPerSecondPerWorker(\n            int stainTraceMaxTracesPerSecondPerWorker) {\n        if (stainTraceMaxTracesPerSecondPerWorker < 0) {\n            throw new IllegalArgumentException(\n                    ServerConfigOptions.STAIN_TRACE_MAX_TRACES_PER_SECOND_PER_WORKER\n                            + \" must be >= 0\");\n        }\n        this.stainTraceMaxTracesPerSecondPerWorker = stainTraceMaxTracesPerSecondPerWorker;\n    }\n\n    public void setStainTraceMaxEntriesPerTrace(int stainTraceMaxEntriesPerTrace) {\n        checkPositive(\n                stainTraceMaxEntriesPerTrace,\n                ServerConfigOptions.STAIN_TRACE_MAX_ENTRIES_PER_TRACE + \" must be > 0\");\n        this.stainTraceMaxEntriesPerTrace = stainTraceMaxEntriesPerTrace;\n    }\n\n    public void setStainTracePropagateToAllSplits(boolean stainTracePropagateToAllSplits) {\n        this.stainTracePropagateToAllSplits = stainTracePropagateToAllSplits;\n    }\n\n    public String getStainTraceFileBasePath() {","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-engine/seatunnel-engine-common/src/main/java/org/apache/seatunnel/engine/common/config/EngineConfig.java#L224-L260","documentation":"EngineConfig.setStainTraceMaxTracesPerSecondPerWorker rejects negative values for the per-worker stain-trace sampling budget, throwing IllegalArgumentException naming the STAIN_TRACE_MAX_TRACES_PER_SECOND_PER_WORKER option. The value caps trace events reported per worker per second; it must be >= 0.","triggerScenarios":"Engine YAML (parsed via parseEngineConfig) or a programmatic/test caller supplies a negative int to the setter.","commonSituations":"Negative number written to disable the feature; sample-rate math producing a negative intermediate fed to the setter; copy-pasted signed constant in fixtures.","solutions":["Set the option to a non-negative integer (e.g. 100) in the engine config.","Use 0 to disable per-worker trace reporting.","Clamp computed values with Math.max(0, v) before the setter.","Remove the key to use the default."],"exampleFix":"// before\nstain-trace:\n  max-traces-per-second-per-worker: -50\n// after\nstain-trace:\n  max-traces-per-second-per-worker: 100","handlingStrategy":"validation","validationCode":"int v = Integer.parseInt(props.getProperty(\"stain-trace.max-traces-per-second-per-worker\", \"0\"));\nif (v < 0) throw new IllegalArgumentException(\"stain-trace per-worker budget must be >= 0, got \" + v);","typeGuard":null,"tryCatchPattern":"try {\n    engineConfig.setStainTraceMaxTracesPerSecondPerWorker(v);\n} catch (IllegalArgumentException e) {\n    throw new ConfigValidationException(\"stain-trace budget invalid: \" + v, e);\n}","preventionTips":["Clamp computed budgets with Math.max(0, v) before the setter.","Use 0 explicitly to disable, never negative.","Cover stain-trace config parsing in unit tests.","Lint configs for negative numeric fields."],"tags":["config","validation","stain-trace"],"backgroundTag":"invalid-config-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}