diag(quic-interop): boot log + build-id verify deployed image is fresh
The [batch]/[interop] traces aren't appearing in the user's runs even after rebuild. To distinguish 'env var not set' from 'binary doesn't have the code', emit a [boot] line at startup that: 1. Reports the QUIC_INTEROP_DEBUG env var value 2. Reports whether writerDebugEnabled was flipped on 3. Includes a build-id constant from WriterDebug.kt If the user's run shows '[boot] DEBUG=1; ... build_id=2026-05-07- batch-log-v1', we know the latest debug code IS deployed. If the boot line is missing OR shows an older build_id, the docker image served stale bytecode (gradle/docker layer caching) and a clean rebuild is needed. Inspect script now greps [boot] and surfaces it BEFORE the rest of the writer-side debug section.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user