Stop using a Session if the delay is already expired#541
Merged
franz1981 merged 1 commit intoHyperfoil:masterfrom Mar 23, 2025
Merged
Stop using a Session if the delay is already expired#541franz1981 merged 1 commit intoHyperfoil:masterfrom
franz1981 merged 1 commit intoHyperfoil:masterfrom
Conversation
Contributor
Author
|
This work is triggered by some investigations around #522 and a follow up to #531 to have a "cleaned up" IDK if @iliepandia wish to give it a shot without using the proposed |
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.
Changes proposed
Currently, due to lack of cpu resources (e.g. on containers, GC, etc etc) a short delay can cause a scheduled task to use a Session which it doesn't "own" anymore, because released after executing the sequence it belongs.
This is happening because:
ScheduleDelayStep::invokeschedule a short living scheduled taskAwaitDelayStepis always executed afterScheduleDelayStep, and due to many reasons, can find the delay to be already expiredSessions completes and got used elsewhereSession::runTaskon aSessionwhich doesn't "own" anymoreWe're not aware of any adverse effect of using a
Sessionwhich we don't own - sinceSessions are single-threaded, at worse it can run some stuckedsteponce more, while making it to progress earlier than expected, which means that it depends by the nature of the step to be executed.Check List