-
Notifications
You must be signed in to change notification settings - Fork 129
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
rt: cancel all in-flight ops on driver drop #158
Conversation
Hmm, it doesn't work as well as expected. |
I don’t think you will find operations in the submission queue. That queue is empty even when operations are in flight.
…-Frank
On Oct 30, 2022, at 3:49 PM, Noah Kennedy ***@***.***> wrote:
Hmm, it doesn't work as well as expected.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Figured out what's wrong. For this to really work, we need to drop the runtime tasks on process exit. |
I need #157 in first to finish this. |
4f515a6
to
f81ba93
Compare
Is this meant to fix the problem caused by exit being called from within the runtime too? If so, I can give it a test. |
Yes, but it doesn't work yet. |
I see. That loop was just to flush any pending sqe's. |
Don't know if you are looking for ideas. Have you tried setting the slab's entry's lifecycle to ignored so when the complete gets called by tick, it will signal a drop to the slab? |
The issue it currently has is that we need to drop the runtime before we can drop this, because all tasks need to be moved to the "ignored" state. So |
I don't follow. The driver drop is synchronous so tasks won't run will they? You mean the ops lifecycles need to be moved to the ignored state? The driver drop is already breaking invariants. Why not have its loop change the lifecycles it finds to ignored? I may be missing something. I'll let you think about it. You can ask me to have a look later if you want. I'm sure you'll figure it out quickly without me looking over your shoulder. |
@Noah-Kennedy are you waiting on a review on this? |
This PR makes https://github.com/hapsoc/hring tests pass again. (They still fail when |
@fasterthanlime Ironically, it is a destructor calling back into our drop that the libc exit is calling for our thread local storage that is causing the problem. Until we looked at the stack, we didn't know there was a libc cleanup per thread when exiting. |
f81ba93
to
79bcfef
Compare
This fixes an immediate issue where ops like Accept can cause runtime shutdown to hang. Unfortunately, it also stalls some work related to multi-shot ops.
79bcfef
to
558a1c3
Compare
@FrankReh this is ready for review. |
I won't be able to review this for at least 12 hours but if the hring rest suite passes with it, it's good with me 👍 |
@fasterthanlime I'm hitting a few errors when trying to run your tests:
|
The |
@Noah-Kennedy yeah sorry, only individual tests will run with "cargo test" — the whole suite requires "cargo nextest run" (since it does one process per test) |
@fasterthanlime thanks, now I'm seeing:
|
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 very neat. Do you mean to commit this before the CompletionList issues are solved too? I wouldn't mind that.
@FrankReh I'd like us to get this in and then figure out what to do about multishot ops. This blocks us getting a release out. |
This fixes an immediate issue where ops like Accept can cause runtime shutdown to hang.
This may need to be revisited once we have a real cancellation story. It may be better to do cancel-on-drop for ops.