Skip to content

Commit 7a716ef

Browse files
committed
fix(qwp): attach the throwable to the drainer's retryable-setup warning
The catch (Exception) setup path in BackgroundDrainer logged only t.getMessage() and stored it as lastErrorMessage. For a JVM-raised NPE (getMessage() == null on JDK 8, the release target) that produced 'drainer setup temporarily unavailable for slot ...: null' with no exception class and no stack trace -- and since this path deliberately leaves no .failed sentinel, a deterministic setup bug is retried on every orphan scan while emitting that same contentless line forever. The outer catches in the same method already attach the throwable (LOG.error(..., slotPath, msg, t)); only this inner retryable catch dropped it. Log the throwable (SLF4J attaches the stack trace) and carry t.toString() -- class plus message -- into lastErrorMessage so the telemetry surface shows 'java.lang.NullPointerException' instead of 'null'. Diagnostics only; the retry-not-quarantine policy is unchanged. sf package: 391 tests green.
1 parent e0ebdf0 commit 7a716ef

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

core/src/main/java/io/questdb/client/cutlass/qwp/client/sf/cursor/BackgroundDrainer.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,15 @@ public void run() {
582582
// unlock. Leave no .failed sentinel for the next orphan scan.
583583
// Error deliberately escapes to the outer Error path: it is
584584
// observable after teardown but cannot quarantine intact data.
585-
String msg = t.getMessage();
585+
// This path retries on every orphan scan, so the log line is
586+
// the ONLY diagnostic a deterministic bug (e.g. an unexpected
587+
// NPE, whose getMessage() is null) ever produces: attach the
588+
// throwable for the stack trace and carry class+message into
589+
// the telemetry surface, mirroring the outer setup-failure
590+
// catch below.
591+
String msg = t.toString();
586592
LOG.warn("drainer setup temporarily unavailable for slot {}: {}",
587-
slotPath, msg);
593+
slotPath, msg, t);
588594
lastErrorMessage = msg;
589595
outcome = DrainOutcome.FAILED;
590596
return;

0 commit comments

Comments
 (0)