Skip to content

fix(iroh-net): Make sure the rtt-actor is shutdown correctly #2914

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

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

flub
Copy link
Contributor

@flub flub commented Nov 8, 2024

Description

When the endpoint is dropped the rtt-actor should be shut down. This
makes sure this actually happens.

Fixes #2911

Breaking Changes

Notes & open questions

Also make sure the task is aborted on drop. We should always do this anyway.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

When the endpoint is dropped the rtt-actor should be shut down.  This
makes sure this actually happens.

Fixes #2911
Copy link

github-actions bot commented Nov 8, 2024

Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh/pr/2914/docs/iroh/

Last updated: 2024-11-12T10:19:16Z

Copy link

github-actions bot commented Nov 8, 2024

Netsim report & logs for this PR have been generated and is available at: LOGS
This report will remain available for 3 days.

Last updated for commit: c4593f7

@PaulOlteanu
Copy link
Contributor

I believe the else branch will only execute if none of the other branch's patterns match. Since the _ = cleanup_interval.tick() pattern can never not match, the else branch won't ever execute.

@flub
Copy link
Contributor Author

flub commented Nov 11, 2024

I believe the else branch will only execute if none of the other branch's patterns match. Since the _ = cleanup_interval.tick() pattern can never not match, the else branch won't ever execute.

@PaulOlteanu thanks for the insight! I guess my metal model of select's branch matching is all wrong.

The docs say that the first branch that completes is returned and all other futures are cancelled. So I was considering at that point there's one value, None, which does not match its pattern so the else branch is executed.

Re-reading the docs:

If the pattern does not match, disable the current branch for the remainder of the current call to select!. Continue from step 3.

So this is why I had this totally wrong, as long as there are enabled branches select does not move on to the else branch or return.

Thanks for making me realise what I had done wrong!

@flub flub added this pull request to the merge queue Nov 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2024
@flub
Copy link
Contributor Author

flub commented Nov 11, 2024

github actions network issues it seems like? try again

@flub flub added this pull request to the merge queue Nov 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2024
@flub flub added this pull request to the merge queue Nov 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 11, 2024
@flub flub added this pull request to the merge queue Nov 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 12, 2024
@flub flub enabled auto-merge November 12, 2024 10:16
@flub flub added this pull request to the merge queue Nov 12, 2024
Merged via the queue into main with commit c96b032 Nov 12, 2024
26 of 27 checks passed
@flub flub deleted the flub/rtt-actor-shutdown branch November 12, 2024 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

RttActor isn't cleaned up on Endpoint drop
3 participants