Skip to content

fix(pool): make Destroy honour its own timeout instead of overrunning it - #63

Closed
xepozz wants to merge 1 commit into
roadrunner-server:masterfrom
xepozz:fix/destroy-respects-its-timeout
Closed

fix(pool): make Destroy honour its own timeout instead of overrunning it#63
xepozz wants to merge 1 commit into
roadrunner-server:masterfrom
xepozz:fix/destroy-respects-its-timeout

Conversation

@xepozz

@xepozz xepozz commented Aug 23, 2026

Copy link
Copy Markdown

Reason for This PR

[Author TODO: add issue # or explain reasoning.]

Description of Changes

destroy_timeout was discarded whenever the caller passed a context with a deadline, and on expiry the workers were asked to stop over the relay instead of killed, which adds another 10s. Bound the context by the tighter of the two and kill on expiry. Reset had the same expiry branch.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

destroy_timeout was discarded whenever the caller passed a context with a deadline,
and on expiry the workers were asked to stop over the relay instead of killed, which
adds another 10s. Bound the context by the tighter of the two and kill on expiry.
Reset had the same expiry branch.
@rustatian

Copy link
Copy Markdown
Member

Deadline timeout from the pool is forced only when the context is not used. And the ensureDeadline function semantics are incorrect in the way you are proposing to use it. Because if it is a timeout (not fallback) - ctx.WithTimeout should be used.
Context is passed by the endure, which controls the whole process.

@rustatian rustatian closed this Aug 23, 2026
@codecov

codecov Bot commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.26%. Comparing base (2ae6f57) to head (581f087).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #63      +/-   ##
==========================================
+ Coverage   78.05%   78.26%   +0.20%     
==========================================
  Files          19       19              
  Lines        1171     1173       +2     
==========================================
+ Hits          914      918       +4     
+ Misses        257      255       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xepozz

xepozz commented Aug 23, 2026

Copy link
Copy Markdown
Author

Destroy overruns whatever deadline it gets: Process.Stop waits a hardcoded 10s, so
destroy_timeout: 1s with no caller deadline returns after 11s

@rustatian

Copy link
Copy Markdown
Member

This is an AI-sloppy way to deal with the problem. While the case is probably worth attention, the way it is fixed is w/o proper understanding of how everything is connected in RR. So my suggestion is first to create a ticket, explain the case, provide a simple sample to reproduce the problem, and your reasoning also, where those problems were observed (probably in the temporal plugin).

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