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(iroh-relay): fix client actors not closing #3134

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

PaulOlteanu
Copy link
Contributor

@PaulOlteanu PaulOlteanu commented Jan 16, 2025

Description

When a client actor closes, it awaits Clients::unregister, which then awaits for the actor task to close, so almost every actor task was being leaked. Since the only place Clients::unregister is called is from when the actor is already closing, I chose to break the cycle by not have it call Client::shutdown.

I also added a timeout to the tls handshake because that also gets stuck forever if the client goes away. I didn't add it to the LetsEncrypt acceptor because I wasn't sure where exactly it belonged, but that should probably have one too. I can move this to a separate PR if preferred. Maybe the timeout should be configurable as well?

Notes & open questions

Change checklist

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

@matheus23 matheus23 requested a review from flub January 24, 2025 08:47
Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

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

Apologies for the long wait, guess this slipped through the cracks...

That's a reasonable way to break that loop.

I haven't looked much at the server side of the relay connections, but I suspect that this entire thing should have been turned on it's head so that the actor task exiting automatically unregisters it from the clients, like the task should be owned by the clients or something. But let's leave that for another day.

Could you file an issue for the still missing timeouts you mention?

@flub flub added this pull request to the merge queue Jan 24, 2025
Merged via the queue into n0-computer:main with commit e5bbbe1 Jan 24, 2025
26 checks passed
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.

2 participants