fix: call proceedNextContext() in reset() and replace test sleeps with semaphores#1011
Open
mPokornyETM wants to merge 1 commit intomasterfrom
Open
fix: call proceedNextContext() in reset() and replace test sleeps with semaphores#1011mPokornyETM wants to merge 1 commit intomasterfrom
mPokornyETM wants to merge 1 commit intomasterfrom
Conversation
410f0a7 to
09eb732
Compare
…h semaphores Fixes #988 LockableResourcesManager.reset() cleared resource state but never called proceedNextContext(), so waiting pipeline jobs were never notified when resources became free via reset(). Every other method that frees resources (unlockResources, unreserve, addResource) already does this. Added the same while(proceedNextContext()){} loop inside reset(). Replaced all sleep() calls in the reserve/setReservedBy-inside-lock tests with SemaphoreStep-based synchronisation, making the tests deterministic and roughly 4x faster (~20s vs ~80s each). Removed the try-catch Bug#2a and Bug#2b tolerance blocks since the reset() fix makes them unnecessary. Affected tests: - LockStepReserveInsideLockHonouredTest - LockStepSetReservedByInsideLockHonouredTest - LockStepTest#reserveInsideLockHonoured - LockStepTest#setReservedByInsideLockHonoured
09eb732 to
dea0e0a
Compare
Contributor
|
|
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.
Fixes #988
Problem
LockableResourcesManager.reset() clears all resource state (lock, reservation, queued context) but never calls proceedNextContext(). Every other method that frees resources (unlockResources(), unreserve(), �ddResource()) does call it. This means waiting pipeline jobs are never notified when resources become free via
eset(), causing a race condition.
Fix
Added while (proceedNextContext()) {} loop inside
eset(), consistent with all other resource-freeing methods.
Test improvements
Replaced all sleep() calls with SemaphoreStep semaphores in 3 test files (4 tests total):
Also removed try-catch workarounds for Bug#2 and tightened assertions to fail fast instead of masking race conditions.