Commit 0c20ba74 authored by jan.koester's avatar jan.koester
Browse files

debug



Co-authored-by: default avatarCopilot <copilot@github.com>
parent d1986abe
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
libnetplus (20260504+2) unstable; urgency=medium
libnetplus (20260504+3) unstable; urgency=medium

  * QUIC: add server-side [QUIC-DIAG] logging for large streams that
    have received FIN but are not yet contiguously complete — logs
    stream ID, FIN offset, contiguous bytes, range count, and first gap
    to diagnose store_stripe response-timeout on remote nodes
  * QUIC: implement PTO (Probe Timeout, RFC 9002 §6.2) — retransmit
    the oldest unacked packet with exponential back-off when the peer
    has not acknowledged tail packets, fixing the "tail loss" deadlock
+23 −0
Original line number Diff line number Diff line
@@ -3472,6 +3472,29 @@ void quic::processStreamFrame(const uint8_t* data, size_t len, size_t& offset) {
        stream.recv_complete = true;
    }
    
    // Diagnostic: log large stream progress for server-side debugging
    if (_is_server && stream.recv_fin && !stream.recv_complete &&
        stream.recv_fin_offset > 65536) {
        size_t range_count = stream.recv_ranges.size();
        uint64_t first_gap_start = 0, first_gap_end = 0;
        if (!stream.recv_ranges.empty()) {
            auto it = stream.recv_ranges.begin();
            if (it->first > 0) {
                first_gap_end = it->first;
            } else if (stream.recv_ranges.size() > 1) {
                first_gap_start = it->second;
                ++it;
                first_gap_end = it->first;
            }
        }
        std::cerr << "[QUIC-DIAG] stream " << stream_id
                  << " FIN at " << stream.recv_fin_offset
                  << " contig=" << stream.recv_contiguous
                  << " ranges=" << range_count
                  << " gap=" << first_gap_start << "-" << first_gap_end
                  << "\n";
    }
    
    // Queue stream dispatch — will be invoked OUTSIDE _quic_mutex
    // so that long-running callbacks (e.g. import) don't block PING ACKs
    // and don't deadlock when the callback calls sendStreamData/flush_out.