Skip to content

Conversation

@patterniha
Copy link
Collaborator

@patterniha patterniha commented Sep 11, 2025

routedDispatch is also used for (pipe)Dispatch(it is still used in some cases) so link should close immediately when routedDispatch failed.
otherwise, inbound/mux remain open without doing anything.

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

把 Mux 等其它入站改成 DispatchLink() 就好了,不需要改这里,不然以后又要删掉多余的代码

@RPRX RPRX closed this Sep 11, 2025
@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

不过 XUDP 那处似乎不好改,那这处还是可以有的,话说 Mux 带了超时机制吗

@RPRX RPRX reopened this Sep 11, 2025
@patterniha
Copy link
Collaborator Author

No, in server-side-mux and for each session, timeout controlled by the (demuxed)outbound.
So, if there is no outbound, session may remain open forever(if we don't receive fin-ack in inbound-connection of corresponding-session-in-client-side)

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

话说 #5100 是有必要的吗,似乎等底层 TCP 连接断了就行?写数据出错的话也会自动断吧

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

现在 Xray 是 conn 出错自动 cancel ctx 还是,我去看下代码

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

貌似没有,本来是想让它底层 conn 断了自动 cancel 的,但它返回后才会调用,由于 DispatchLink(),这个权限被传递给最后一级了

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

然后 mux 这里由于没传递给最后一级,就需要 mux 本身来处理“出错->返回”这件事

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

对于 mux 这种也无法传递给最后一级,不然无法实现 mux

@RPRX
Copy link
Member

RPRX commented Sep 11, 2025

总之以上讨论几乎与这个 PR 无关,先合了吧

@RPRX RPRX changed the title Dispatcher: Close link when routedDispatch failed app/dispatcher/default.go: Close link when routedDispatch() failed Sep 11, 2025
@RPRX RPRX merged commit 3167e5c into main Sep 11, 2025
121 of 125 checks passed
@RPRX RPRX deleted the fix-fail-dispatch branch September 11, 2025 12:37
@patterniha
Copy link
Collaborator Author

patterniha commented Sep 12, 2025

@RPRX

also, ss2022 outbound does not implement connIdle, so we may have goroutine leak.

but because it uses "sagernet/sing" pkg, it is impossible to implement timer and update the timer after each send/receive-packet(unless we use our own modified-pkg)

This is not my concern and I have no interest in working on it

@gfw-killer
Copy link

ss2022 was planned to get removed because of license issues #3272
and Encrypted VLESS is available, there is no need to ss2022
don't waste your time to debug it, instead you can PR to remove it from Xray-core

Dimas862 pushed a commit to Dimas862/Xray-core that referenced this pull request Oct 15, 2025
Revert "v25.10.15"

This reverts commit b69a376.

Revert "VLESS Reverse Proxy: Transfer real Source & Local (IP & port), enabled by default"

This reverts commit 12f4a01.

Revert "XHTTP client: Change default `maxConcurrency` to 1 for speed testing"

This reverts commit 9cc7907.

Revert "Router: Use built-in-dns only once for all rules (in "IPOnDemand"/"IPIfNonMatch" mode) (XTLS#5210)"

This reverts commit 21a9658.

Revert "README.md: Add PasarGuard to Web Panels (XTLS#5224)"

This reverts commit 7f436f5.

Revert "Update github.com/xtls/reality to 20251014195629"

This reverts commit dcfde8d.

Revert "Bump golang.org/x/net from 0.44.0 to 0.46.0 (XTLS#5215)"

This reverts commit 898db92.

Revert "Bump google.golang.org/grpc from 1.75.1 to 1.76.0 (XTLS#5212)"

This reverts commit 8dd0e38.

Revert "transport/internet/reality/reality.go: Safely get negotiated CurveID in VerifyPeerCertificate()"

This reverts commit 40f0a54.

Revert "Bump github.com/refraction-networking/utls from 1.8.0 to 1.8.1 (XTLS#5229)"

This reverts commit 1762d6c.

Revert "Fix shadowsocks2022 memory leak (XTLS#5166)"

This reverts commit 1952488.

Revert "fix: darwin arm64 always has AESGCMHardwareSupport (XTLS#5176)"

This reverts commit 4a825c0.

Revert "Bump github.com/quic-go/quic-go from 0.54.1 to 0.55.0 (XTLS#5208)"

This reverts commit 514c9e5.

Revert "feat(config): add unix socket HTTP config loader support (XTLS#5200)"

This reverts commit 2f366ae.

Revert "Fix vless reverse panic in vision (XTLS#5189)"

This reverts commit c0c88f3.

Revert "Bump github.com/quic-go/quic-go from 0.54.0 to 0.54.1 (XTLS#5180)"

This reverts commit d0344bc.

Revert "Bump google.golang.org/protobuf from 1.36.9 to 1.36.10 (XTLS#5203)"

This reverts commit a6ebb30.

Revert "Outbound: One endpoint and at most one user only (XTLS#5144)"

This reverts commit fe57507.

Revert "Config: Outbound proxy config no need to be nested (XTLS#5124)"

This reverts commit 83c5370.

Revert "Bump google.golang.org/grpc from 1.75.0 to 1.75.1 (XTLS#5129)"

This reverts commit 1a48453.

Revert "app/dispatcher/default.go: Close link when routedDispatch() failed (XTLS#5131)"

This reverts commit 3167e5c.

Revert "app/dispatcher/default.go: Add comment on run-time rejecting non-existent outbound tag"

This reverts commit 5148c57.
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