Skip to content

Commit 4d5790f

Browse files
vahidlazioclaude
andcommitted
feat(tunnel): fully separated upload/download tasks, wseq write ordering
Architecture: - Upload task (spawned): reads client socket → sends MuxMsg::Data with wseq directly to mux → sends InflightEntry to download task. Fully independent, never blocked by downloads. - Download task (inline): processes replies, sends refill polls (timer), accepts InflightEntry. Never blocked by uploads. - Lock-free mpsc channels throughout — no Mutex contention. Write ordering (wseq): - Client assigns monotonic wseq to data-bearing ops only (not polls). - Tunnel-node buffers out-of-order writes per session, flushes in wseq order. Backward compatible: old clients without wseq write immediately. - Fixes data corruption from pipelined batches completing out of order. Upload accumulation: - Adaptive: 50ms initial window for small messages (low latency). - If >= 32KB accumulated, extend to 1s / 1MB cap (fat uploads for files). Other: - Removed consecutive_empty gate on refill (was killing idle sessions). - Tunnel-node reader buffer 2MB (was 512KB). - Removed legacy detection (was false-triggering on merged replies). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 47b22b9 commit 4d5790f

3 files changed

Lines changed: 487 additions & 308 deletions

File tree

src/domain_fronter.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ pub struct BatchOp {
532532
pub d: Option<String>,
533533
#[serde(skip_serializing_if = "Option::is_none")]
534534
pub seq: Option<u64>,
535+
#[serde(skip_serializing_if = "Option::is_none")]
536+
pub wseq: Option<u64>,
535537
}
536538

537539
/// Batch tunnel response from Apps Script / tunnel node.

0 commit comments

Comments
 (0)