diff --git a/quic/interop/inspect-multiplexing.sh b/quic/interop/inspect-multiplexing.sh index 50c27ecbf..02481cadb 100755 --- a/quic/interop/inspect-multiplexing.sh +++ b/quic/interop/inspect-multiplexing.sh @@ -38,7 +38,12 @@ echo "=============== writer-side debug traces (DEBUG=1 build only) ============ # `grep -c` exits 1 on no matches AND prints "0", so a naive # `grep -c ... || echo 0` doubles up. Suppress the exit code # instead. -WRITER_LINES=$(grep -cE '\[(writer|batch|interop)' "$CASE_DIR/output.txt" 2>/dev/null) || WRITER_LINES=0 +echo +echo "=============== boot line (verifies image has latest debug build) ===============" +grep '\[boot\]' "$CASE_DIR/output.txt" 2>/dev/null | head -n 5 \ + || echo "(no [boot] lines — image is older than the boot log; rebuild with: DEBUG=1 ./quic/interop/run-matrix.sh ...)" + +WRITER_LINES=$(grep -cE '\[(writer|batch|interop|boot)' "$CASE_DIR/output.txt" 2>/dev/null) || WRITER_LINES=0 if [[ "$WRITER_LINES" -gt 0 ]]; then echo "($WRITER_LINES diagnostic lines; [batch] / [interop] entries first then first 30 [writer.app]:)" # Use `|| true` because grep returns 1 on no matches and the diff --git a/quic/interop/src/main/kotlin/com/vitorpamplona/quic/interop/runner/InteropClient.kt b/quic/interop/src/main/kotlin/com/vitorpamplona/quic/interop/runner/InteropClient.kt index d9ce893f0..ccda033a7 100644 --- a/quic/interop/src/main/kotlin/com/vitorpamplona/quic/interop/runner/InteropClient.kt +++ b/quic/interop/src/main/kotlin/com/vitorpamplona/quic/interop/runner/InteropClient.kt @@ -85,8 +85,15 @@ private const val MULTIPLEX_PARALLELISM = 64 fun main() { // Single env-var check, propagated to library code that opts into // verbose tracing only when this is set. - if (System.getenv("QUIC_INTEROP_DEBUG") == "1") { + val debugEnv = System.getenv("QUIC_INTEROP_DEBUG") + if (debugEnv == "1") { com.vitorpamplona.quic.connection.writerDebugEnabled = true + System.err.println( + "[boot] DEBUG=1; writerDebugEnabled=true; build_id=" + + "${com.vitorpamplona.quic.connection.WRITER_DEBUG_BUILD_ID}", + ) + } else { + System.err.println("[boot] DEBUG=${debugEnv ?: "(unset)"} writerDebugEnabled=false") } val role = System.getenv("ROLE") ?: "client" diff --git a/quic/src/commonMain/kotlin/com/vitorpamplona/quic/connection/WriterDebug.kt b/quic/src/commonMain/kotlin/com/vitorpamplona/quic/connection/WriterDebug.kt index 6955974aa..ff3aebd7b 100644 --- a/quic/src/commonMain/kotlin/com/vitorpamplona/quic/connection/WriterDebug.kt +++ b/quic/src/commonMain/kotlin/com/vitorpamplona/quic/connection/WriterDebug.kt @@ -32,3 +32,11 @@ package com.vitorpamplona.quic.connection */ @Volatile var writerDebugEnabled: Boolean = false + +/** + * Build identifier injected into the boot log so we can verify the + * deployed image actually has the latest debug code (i.e. that the + * docker layer cache didn't serve a stale jar). Bump when adding new + * trace lines to make them traceable from the wire run. + */ +const val WRITER_DEBUG_BUILD_ID: String = "2026-05-07-batch-log-v1"