Skip to content

New argument --kill-wait controls maximum time earlyoom waits for a killed process to exit#366

Open
iandennismiller wants to merge 2 commits intorfjakob:masterfrom
iandennismiller:feature-kill-wait
Open

New argument --kill-wait controls maximum time earlyoom waits for a killed process to exit#366
iandennismiller wants to merge 2 commits intorfjakob:masterfrom
iandennismiller:feature-kill-wait

Conversation

@iandennismiller
Copy link

@iandennismiller iandennismiller commented Feb 18, 2026

This pull request introduces a new configurable option, --kill-wait SECONDS, to control the maximum time earlyoom waits for a killed process to exit. The implementation includes updates to the CLI, input validation, documentation, and associated tests. This change allows users to adjust the wait timeout (default 10 seconds) to better handle processes that take longer to terminate.

New feature: Configurable process wait timeout

  • Added a --kill-wait SECONDS command-line option to set the maximum wait time (in seconds) for a killed process to exit, with input validation.
  • Updated the poll_loop_args_t struct and related logic to store and use the new kill_wait_timeout_secs value, defaulting to 10 seconds.
  • Modified the process waiting logic in kill_wait to use the user-specified timeout.

Documentation and testing

  • Updated the documentation (MANPAGE.md, README.md) to describe the new --kill-wait option and its usage.
  • Added and updated CLI tests to verify correct handling of the --kill-wait flag, including invalid values and edge cases.

Internal constants and options

  • Introduced a new constant for the maximum allowed wait timeout and updated the CLI options enum accordingly.

@iandennismiller
Copy link
Author

This PR replaces #363, which had been prematurely merged. The current PR stays in a separate branch to maintain separation from work in master.

@rfjakob
Copy link
Owner

rfjakob commented Feb 24, 2026

Tests fail:

--- FAIL: TestCli/--kill-wait_100000 (0.00s)

Copy link
Owner

@rfjakob rfjakob left a comment

Choose a reason for hiding this comment

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

Tests fail:

--- FAIL: TestCli/--kill-wait_100000 (0.00s)

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.

2 participants