Skip to content

feat: make executor timeout configurable via server config#6285

Open
NETIZEN-11 wants to merge 2 commits intomindersec:mainfrom
NETIZEN-11:feat/configurable-executor-timeout-6282
Open

feat: make executor timeout configurable via server config#6285
NETIZEN-11 wants to merge 2 commits intomindersec:mainfrom
NETIZEN-11:feat/configurable-executor-timeout-6282

Conversation

@NETIZEN-11
Copy link
Copy Markdown

Description

Fixes #6282

This PR makes the executor timeout configurable via server configuration instead of being hardcoded. Previously, the executor relied on a fixed DefaultExecutionTimeout, which limited flexibility across different environments (e.g., development, CI, production).

With this change, users can now control execution timeout behavior through configuration without modifying code.


Changes

  • Added ExecutionTimeout field to EventConfig (default: 5m)
  • Propagated timeout value through config → service → executor handler
  • Updated ExecutorEventHandler to use configurable timeout
  • Implemented safe fallback to DefaultExecutionTimeout for invalid values (≤ 0)
  • Added initialization logging for effective timeout value
  • Updated service layer to inject configuration into handler
  • Added comprehensive unit tests for timeout configuration and fallback behavior
  • Updated example configuration and documentation

Behavior

  • If execution_timeout > 0 → use configured value
  • If execution_timeout ≤ 0 or missing → fallback to DefaultExecutionTimeout

Configuration Example

events:
  execution_timeout: 10m  # Custom timeout (default: 5m)

Testing

  • All existing tests pass

  • Added TestNewExecutorEventHandler_TimeoutConfiguration

  • Covered:

  • Custom timeout usage

  • Zero value fallback

  • Negative value fallback

  • No regressions observed

  • Build and lint checks pass


Notes

  • Backward compatible (no breaking changes)
  • Follows existing configuration patterns
  • Minimal and clean implementation aligned with project structure

Checklist

  • Feature implemented as per proposal
  • Acceptance criteria satisfied
  • Tests added and passing
  • Lint checks passing
  • Documentation updated

- Add ExecutionTimeout field to EventConfig with 5m default
- Update ExecutorEventHandler to accept and use configurable timeout
- Implement fallback to DefaultExecutionTimeout for invalid values
- Add logging for effective timeout during initialization
- Update service layer to pass config timeout to handler
- Add comprehensive tests for timeout configuration and fallback
- Update example config with execution_timeout documentation

Fixes mindersec#6282

Signed-off-by: NETIZEN-11 <kumarnitesh121411@gmail.com>
@NETIZEN-11 NETIZEN-11 requested a review from a team as a code owner April 6, 2026 06:18
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 6, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Could you coordinate with #6278 (and the comments there), since this seems to be a duplicate of that PR?

In particular, see the comment on #6278 (comment) about testing the timeout / cancellation behavior with a small requested timeout of e.g. 1-5 seconds, and a task which would try to execute for longer?

@evankanderson
Copy link
Copy Markdown
Member

Hello @NETIZEN-11 -- are you likely to return to this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make executor timeout configurable via server config

3 participants