-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Use context interrupts consistently in more places #11511
Conversation
(cherry picked from commit 0410b7e)
This PR looks good to me altho I do not own a bunch of this code. The cannon diff is important to have somebody look at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, few nits, mostly comments that you left and kind of already answered yourself, just need to be addressed to not leave new questions in the code.
I think the only pending question is whether the stdout punting is still wanted (someone might be expecting to see the "exiting..." message while using cannon. If so it would make sense to do that everytime an interrupt is received, probably by providing a small callback in cannon so that you only see the message on stdout if the signal is actually being handled by whoever is waiting on the interrupts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cannon, op-challenger, and op-dispute-mon changes look good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Added a commit to address the review comments that were left open, and merged in develop
to resolve conflicts.
Looks good. This is still stuck on a code owner 😬 @mslipper @zhwrd @0x00101010 ? |
Thanks @zhwrd ! |
This was a fix that came out of fixing the shutdown handling when testing various services.
Mainly I made the signal use for interrupting contexts consistent, it was using different signals in different places, and not always using the interrupt waiter interface even though that was the intent.
There were a few places were unnecessary goroutines were spun out and cancellation was missed or not handled as intended. There's also a place where the context wasn't being used and a new cancellation method introduced to work around it, which wasn't the intent I think it was just missed in a refactor.
The rename from opio to ctxinterrupt seems a bit noisy but I think it conveys the intent better and removes some stutter around the naming.