Skip to content
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

CA-379971: Ensure ParallelAction is not waiting on _lock when no actions are running #3244

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

danilo-delbusso
Copy link
Member

One could also fix this by not running actions as soon as the EnqueueAction is called (or maybe calling Monitor.Wait before the actions have started), but I didn't want to touch a lot of this code and potentially add new issues.


The issue we're fixing here is that there is a chance that all actions have completed before we hit the Wait call, we need to make sure we don't hit a deadlock.

This can happen if for instance there is only one action, and it is a "dummy" action, such as the one used in the EUA check.

Also I have removed the compound assignment for the volatile _completedActionsCount since Visual Studio was flagging it as a "suspicious usage of a volatile variable". I personally don't think it's a problem but better safe than sorry.

Contains minor whitespace fixes, too

…actions are running

There is a chance that all actions have completed before we hit the `Wait` call, we need to make sure we don't hit a deadlock.

This can happen if for instance there is only one action, and it is a "dummy" action, such as the one used in the EUA check.

Also I have removed the compound assignment for the `volatile _completedActionsCount` since Visual Studio was flagging it as a "suspicious usage of a volatile variable". I personally don't think it's a problem but better safe than sorry.

Contains minor whitespace fixes, too

Signed-off-by: Danilo Del Busso <[email protected]>
@danilo-delbusso danilo-delbusso self-assigned this Oct 25, 2023
@danilo-delbusso danilo-delbusso added the ASAP PR should be reviewed as soon as possible label Oct 25, 2023
@kc284 kc284 added the 1 approval PR has been approved by one reviewer label Oct 25, 2023
@CitrixChris CitrixChris added 2 approvals PR has been approved by two reviewers and removed 1 approval PR has been approved by one reviewer labels Oct 26, 2023
@kc284 kc284 merged commit 82ffd50 into xenserver:master Oct 26, 2023
1 check passed
@danilo-delbusso danilo-delbusso deleted the bug/XCA_CA-379971 branch October 26, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 approvals PR has been approved by two reviewers ASAP PR should be reviewed as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants