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

Fix termination bug #57

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Fix termination bug #57

merged 1 commit into from
Oct 18, 2024

Conversation

smklein
Copy link
Collaborator

@smklein smklein commented Oct 18, 2024

Fix a return not returning enough.

TL:DR: The following code loops forever, because return returns from the async block, not from foobar.

async fn foobar() {
  loop {
     async {
        return;
     }.await;
  }
}

This issue impacted slot teardown, and could result in re-using a oneshot::Receiver.

This PR fixes that issue, and adds additional tests for termination (which fail without the patch).

@smklein smklein requested a review from hawkw October 18, 2024 00:20
@@ -590,19 +590,30 @@ impl<Conn: Connection> SetWorker<Conn> {
{
// The slot was instructed to exit
// before it connected. Bail.
return;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short: The bug is here.

@smklein
Copy link
Collaborator Author

smklein commented Oct 18, 2024

Gonna merge this aggressively to see if it helps oxidecomputer/omicron#6881 , but I wanted to give you a heads-up -- this feels like a very silly mistake I made

@smklein smklein merged commit 33553c9 into master Oct 18, 2024
4 checks passed
@smklein smklein deleted the termination-bug branch October 18, 2024 00:24
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

Successfully merging this pull request may close these issues.

1 participant