Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e813c2f044 | |||
| 0b8c1f0b57 |
@@ -1,5 +1,12 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-03-16 - 4.5.9 - fix(remoteingress-core)
|
||||||
|
delay stream close until downstream response draining finishes to prevent truncated transfers
|
||||||
|
|
||||||
|
- Waits for the hub-to-client download task to finish before sending the stream CLOSE frame
|
||||||
|
- Prevents upstream reads from being cancelled mid-response during asymmetric transfers such as git fetch
|
||||||
|
- Retains the existing timeout so stalled downloads still clean up safely
|
||||||
|
|
||||||
## 2026-03-16 - 4.5.8 - fix(remoteingress-core)
|
## 2026-03-16 - 4.5.8 - fix(remoteingress-core)
|
||||||
ensure upstream writes cancel promptly and reliably deliver CLOSE_BACK frames
|
ensure upstream writes cancel promptly and reliably deliver CLOSE_BACK frames
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/remoteingress",
|
"name": "@serve.zone/remoteingress",
|
||||||
"version": "4.5.8",
|
"version": "4.5.9",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.",
|
"description": "Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -749,27 +749,24 @@ async fn handle_client_connection(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send CLOSE frame via DATA channel (must arrive AFTER last DATA for this stream).
|
// Wait for the download task (hub → client) to finish BEFORE sending CLOSE.
|
||||||
// Use send().await to guarantee delivery (try_send silently drops if channel full).
|
// Upload EOF (client done sending) does NOT mean the response is done.
|
||||||
if !client_token.is_cancelled() {
|
// For asymmetric transfers like git fetch (small request, large response),
|
||||||
let close_frame = encode_frame(stream_id, FRAME_CLOSE, &[]);
|
// the response is still streaming when the upload finishes.
|
||||||
let _ = tunnel_data_tx.send(close_frame).await;
|
// Sending CLOSE before the response finishes would cause the hub to cancel
|
||||||
}
|
// the upstream reader mid-response, truncating the data.
|
||||||
|
|
||||||
// Wait for the download task (hub → client) to finish draining all buffered
|
|
||||||
// response data. Upload EOF just means the client is done sending; the download
|
|
||||||
// must continue until all response data has been written to the client.
|
|
||||||
// This is critical for asymmetric transfers like git fetch (small request, large response).
|
|
||||||
// The download task will exit when:
|
|
||||||
// - back_rx returns None (back_tx dropped below after await, or hub sent CLOSE_BACK)
|
|
||||||
// - client_write fails (client disconnected)
|
|
||||||
// - client_token is cancelled
|
|
||||||
let _ = tokio::time::timeout(
|
let _ = tokio::time::timeout(
|
||||||
Duration::from_secs(300), // 5 min max wait for download to finish
|
Duration::from_secs(300), // 5 min max wait for download to finish
|
||||||
&mut hub_to_client,
|
&mut hub_to_client,
|
||||||
).await;
|
).await;
|
||||||
|
|
||||||
// Now safe to clean up — download has finished or timed out
|
// NOW send CLOSE — the response has been fully delivered (or timed out).
|
||||||
|
if !client_token.is_cancelled() {
|
||||||
|
let close_frame = encode_frame(stream_id, FRAME_CLOSE, &[]);
|
||||||
|
let _ = tunnel_data_tx.send(close_frame).await;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clean up
|
||||||
{
|
{
|
||||||
let mut writers = client_writers.lock().await;
|
let mut writers = client_writers.lock().await;
|
||||||
writers.remove(&stream_id);
|
writers.remove(&stream_id);
|
||||||
|
|||||||
@@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@serve.zone/remoteingress',
|
name: '@serve.zone/remoteingress',
|
||||||
version: '4.5.8',
|
version: '4.5.9',
|
||||||
description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.'
|
description: 'Edge ingress tunnel for DcRouter - accepts incoming TCP connections at network edge and tunnels them to DcRouter SmartProxy preserving client IP via PROXY protocol v1.'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user