Skip to content

SplitHTTP server: Fix panic during concurrent Close and Push#3593

Merged
mmmray merged 1 commit intoXTLS:mainfrom
mmmray:splithttp-server-panic
Jul 26, 2024
Merged

SplitHTTP server: Fix panic during concurrent Close and Push#3593
mmmray merged 1 commit intoXTLS:mainfrom
mmmray:splithttp-server-panic

Conversation

@mmmray
Copy link
Contributor

@mmmray mmmray commented Jul 25, 2024

When Close and Push are called concurrently, it may happen that Push attempts to write to an already-closed channel, and trigger a panic.

From a user perspective, it results in logs like this:

http: panic serving 172.19.0.6:50476: send on closed channel

It's probably triggered when download is closed at the same time an upload packet is submitted.

These panics don't crash the server and the inbound is still usable.

When Close and Push are called concurrently, it may happen that Push
attempts to write to an already-closed channel, and trigger a panic.

From a user perspective, it results in logs like this:

    http: panic serving 172.19.0.6:50476: send on closed channel

It's probably triggered when download is closed at the same time an
upload packet is submitted.

These panics don't crash the server and the inbound is still usable.
@mmmray mmmray merged commit 2becdd6 into XTLS:main Jul 26, 2024
@mmmray mmmray deleted the splithttp-server-panic branch July 26, 2024 02:36
leninalive pushed a commit to amnezia-vpn/amnezia-xray-core that referenced this pull request Oct 29, 2024
When Close and Push are called concurrently, it may happen that Push attempts to write to an already-closed channel, and trigger a panic.

From a user perspective, it results in logs like this:

    http: panic serving 172.19.0.6:50476: send on closed channel

It's probably triggered when download is closed at the same time an upload packet is submitted.

These panics don't crash the server and the inbound is still usable.
it2konst pushed a commit to it2konst/gametunnel-core that referenced this pull request Mar 1, 2026
When Close and Push are called concurrently, it may happen that Push attempts to write to an already-closed channel, and trigger a panic.

From a user perspective, it results in logs like this:

    http: panic serving 172.19.0.6:50476: send on closed channel

It's probably triggered when download is closed at the same time an upload packet is submitted.

These panics don't crash the server and the inbound is still usable.
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.

1 participant