-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrong bounds of and concurrent access to counter on pipeline test #1072
Conversation
cscs-ci run |
1 similar comment
cscs-ci run |
Note as you are already fixing test_pipeline.cpp:
(with clang14) |
b21b4f9
to
daa8680
Compare
cscs-ci run |
Do you see that in CI? If yes, are we again missing warnings-as-errors? |
This reverts commit daa8680.
The test seems to fail a bit more reliably with the sleeps introduced in daa8680: https://gitlab.com/cscs-ci/ci-testing/webhook-ci/mirrors/4700071344751697/7514005670787789/-/pipelines/1132292952. @rasolca I've also changed the seeding of the generator to something that I think will silence the warning. |
cscs-ci run |
There was an unrelated failure again waiting for a job to finish: https://gitlab.com/cscs-ci/ci-testing/webhook-ci/mirrors/4700071344751697/7514005670787789/-/jobs/5894331404. I've restarted the job. |
cscs-ci run |
@rasolca I've changed some, but not all, |
No, I was getting it on my laptop. |
In the particular test three read-only accesses to a pipeline are started concurrently using
start_detached
. Each access increments a counter, and the order in which they are incremented depends on when tasks are scheduled (since read-only access may happen concurrently). Thus the expected value of the counter in each of the three tasks is between 27 and 29. One of the tasks incorrectly had the bounds as 27 to 27 (i.e. exactly 27). Since this was the first task this would frequently be true, but is not guaranteed to be true.Additionally, the modification of the counter in read-only sections was unprotected (and the counter was not atomic). This adds a lock to protect access to the counter.