asadjan4611 opened a new pull request, #18050:
URL: https://github.com/apache/dolphinscheduler/pull/18050

   ## Purpose of the pull request
   
   Close: #18034
   
   The Script Alert Plugin executes external scripts to send alerts. Currently, 
ProcessUtils.executeScript() calls process.waitFor() with no timeout. If a 
script hangs (network stall, deadlock, etc.), it permanently blocks a thread in 
the alert sender thread pool, degrading or blocking all alert delivery.
   
   This PR adds a configurable timeout parameter (default: 60 seconds) to the 
Script Alert Plugin following the same pattern used by the HTTP Alert Plugin.
   
   ## Brief change log
   
   - Add SCRIPT_TIMEOUT, NAME_SCRIPT_TIMEOUT, DEFAULT_SCRIPT_TIMEOUT constants 
to ScriptParamsConstants
   - Add InputNumberParam timeout parameter to 
ScriptAlertChannelFactory.params()
   - Replace blocking process.waitFor() with process.waitFor(timeout, 
TimeUnit.SECONDS) in ProcessUtils
   - Destroy process forcibly and interrupt stream gobblers on timeout
   - Parse timeout config in ScriptSender with fallback to default
   - Handle timeout exit code with clear error message in alert result
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - Added ProcessUtilsTest.testExecuteScriptTimeout to verify process timeout 
and forced destruction (returns exit code -2)
   - Added ScriptSenderTest.testDefaultTimeout to verify default timeout works 
correctly
   - Added ScriptSenderTest.testCustomTimeout to verify custom timeout value is 
parsed and applied
   - Updated ScriptAlertChannelFactoryTest.testGetParams to verify new param 
count (3 → 4)
   - Compilation verified locally with `mvn clean compile`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to