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

stop the loop when listener is closed #261

Merged
merged 5 commits into from
Nov 4, 2024
Merged

Conversation

WeidiDeng
Copy link
Contributor

Fix 258.

@mholt
Copy link
Owner

mholt commented Oct 28, 2024

Thanks Weidi! As usual you beat me to it. Do you know why this is needed though? Like why doesn't closing the listener bump out of the Accept loop? (Only when SSH connections are active...?)

@WeidiDeng
Copy link
Contributor Author

The listener wrapper is used in my own listener plugin, which is only used on linux. I guess because listeners on linux use port reuse by default, the error there was temporary. On other platforms, it's implemented via a deadline, which is temporary.

@WeidiDeng
Copy link
Contributor Author

It's not ssh though, the listener loop is still running, and the error here is never received, because this listener silently discard it.

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

Just one idea to make things a bit simpler...

layer4/listener.go Show resolved Hide resolved
@Monviech
Copy link

Monviech commented Nov 1, 2024

Should I test this again or is it ready?

@mholt
Copy link
Owner

mholt commented Nov 1, 2024

I'll circle back to this soon! Been busy

@Monviech
Copy link

Monviech commented Nov 1, 2024

@mholt No stress just wanted to ask <3

@mholt
Copy link
Owner

mholt commented Nov 4, 2024

CI failure seems unrelated

@mholt mholt merged commit ec8fae2 into mholt:master Nov 4, 2024
0 of 6 checks passed
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.

Caddy will not gracefully stop when SSH is proxied
3 participants