Ensure world termination completes under IO saturation - #475
Merged
adamruzicka merged 3 commits intoSep 25, 2026
Merged
Conversation
Use JSON 2 on Ruby versions that cannot install the multi_json release with JSON 3 keyword-argument support. Wait for polling timers to be scheduled before advancing the managed clock.
Contributor
|
It looks reasonable, could we get some sort of test for the saturated IO executor situation? |
Contributor
Author
|
Good point. I added a deterministic regression test in d885a7a. It replaces the global IO executor with a single-thread pool, blocks its only worker, and verifies that world termination still resolves through the watchdog. The test passes with this change and fails against master on the termination wait timeout. |
adamruzicka
approved these changes
Sep 25, 2026
Contributor
|
Thank you @jakduch ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
World termination schedules its timeout watchdog as a Concurrent::Promises.future and its completion callback on the same global IO executor used by persistence work. When PostgreSQL is unavailable and that executor is saturated by retries, the shutdown can reach local component cleanup but never complete.
This is exposed by the concurrent-ruby 1.3.x update in #473. The same update also exposes timing-sensitive WithPollingSubPlans assertions and a Ruby 3.0 incompatibility between multi_json 1.19.1 and JSON 3.
Changes
Verification
Tracking issue: https://projects.theforeman.org/issues/39799
Related: #473 and https://projects.theforeman.org/issues/39353