Skip to content

Conversation

@patterniha
Copy link
Collaborator

@patterniha patterniha commented Sep 8, 2025

fix problems:

  1. after using DispatchLink, we may have goroutine-leak when connection between mux-client and mux-server cut.

  2. in some cases in mux dispatchLink wait on wrong things and it cause code-stuck and goroutine leak.

  3. for reverse, we may have goroutine-leak when a sub-client-connection cut

///

  1. most NAT TCP translations time out is 24 hours, so change splice-timeout to 24 hours.

@Fangliding
Copy link
Member

Fangliding commented Sep 8, 2025

你真的可以在旧版本触发出来这些bug吗

@patterniha
Copy link
Collaborator Author

patterniha commented Sep 8, 2025

你真的可以在旧版本触发出来这些bug吗

this bugs appear after using DispatcherLink, for example if connection between mux-client and mux-server cut(with no fin-ack), the code stuck in:

err := meta.Unmarshal(reader)

so we should implement "monitor" for mux-server too(when we have no session and server-mux is idle for a 60 seconds, ServerWorker should be closed, it is safe because client-mux closes after 16-seconds idle-time)

///

or on the client-side, "DispatcherLink" waited on fetchInput and as a result waited on:

if err := buf.Copy(s.input, writer); err != nil {

but if sub-client-inbound-connection cut(with no fin-ack), the code stuck here, because now s.input is not pipe-reader and common.Interrupt(s.input) has no effect, so we should implement done.Instance for Session and DispatcherLink should wait on it.

@RPRX
Copy link
Member

RPRX commented Sep 8, 2025

没有破坏 XUDP UoT Migration 吧

@patterniha
Copy link
Collaborator Author

It has nothing to do with XUDP, just added "monitor" for mux-server-side.
also dispatcherLink should not wait on inbound-reader, because inbound-reader may ends only after dispatcherLink ends, and this cause stuck.(when no fin-ack received)

@patterniha
Copy link
Collaborator Author

checked again and ready.

@patterniha
Copy link
Collaborator Author

rebased.

@RPRX RPRX merged commit 9f5dcb1 into main Sep 10, 2025
78 checks passed
@RPRX RPRX deleted the fix-idle-mux branch September 10, 2025 00:33
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.

4 participants