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

Avoid labeling race conditions #78

Open
timokau opened this issue Jul 13, 2020 · 2 comments
Open

Avoid labeling race conditions #78

timokau opened this issue Jul 13, 2020 · 2 comments

Comments

@timokau
Copy link
Owner

timokau commented Jul 13, 2020

This is especially relevant after #76. When somebody leaves multiple comments in a pull request review, all of them (and the final review submission) can trigger the same -> awaiting_reviewer transition. They will race, and all but the first one will raise an exception since they try to re-remove the old label.

Not sure how best to prevent this. Just ignoring the error is an option, but not a very nice one. Another option would be to re-fetch the issue before setting a label, but that only tightens the window for the race condition.

@timokau
Copy link
Owner Author

timokau commented Jul 13, 2020

Discovered in NixOS/nixpkgs#92697 (review).

@timokau
Copy link
Owner Author

timokau commented Jul 14, 2020

One possible fix might be to just re-fetch the issue and retry setting the status when label-removal fails. Alternatively, just give up at that point. Both options are not perfect, but will at least avoid inconsistent labels (2 statuses at once).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant