Search before asking
What happened
The Script Alert Plugin executes external scripts to send alerts. The process execution waits indefinitely (blocking waitFor()), and there is no configurable timeout. If a script hangs (network stall, deadlock, etc.), it can permanently occupy a thread in the alert sender thread pool, degrading or blocking alert delivery.
References:
- dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ScriptSender.java
- dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-script/src/main/java/org/apache/dolphinscheduler/plugin/alert/script/ProcessUtils.java
What you expected to happen
- Script execution should support a configurable timeout.
- When timeout occurs, the process should be terminated and an error should be reported in the alert result/logs.
How to reproduce
- Configure Script Alert Plugin with a script that never exits (e.g.,
sleep 999999 or a script that blocks on I/O).
- Trigger multiple alerts.
- Observe alert sending threads get stuck and alerts stop being delivered promptly.
Anything else
Acceptance criteria:
- Add a configurable timeout parameter for the script plugin (documented and exposed consistently).
- Implement process timeout handling (destroy process + cleanup stream gobblers) and return a clear failure message.
- Add unit/integration test(s) verifying timeout behavior.
Version
dev
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
The Script Alert Plugin executes external scripts to send alerts. The process execution waits indefinitely (blocking
waitFor()), and there is no configurable timeout. If a script hangs (network stall, deadlock, etc.), it can permanently occupy a thread in the alert sender thread pool, degrading or blocking alert delivery.References:
What you expected to happen
How to reproduce
sleep 999999or a script that blocks on I/O).Anything else
Acceptance criteria:
Version
dev
Are you willing to submit PR?
Code of Conduct