Skip to content

Commit 8f643ad

Browse files
chore: record debug tag before throwing on unexpected drainedFuture failure
The catch branch in awaitTerminated is reachable only if drainedFuture is ever completed exceptionally or cancelled — neither happens today, but if it ever does we should leave a telemetry breadcrumb instead of just an uncaught IllegalStateException for the caller to puzzle over. Mirror the precondition-failure pattern used elsewhere in this file (record at ERROR, then throw).
1 parent 97db090 commit 8f643ad

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session

‎java-bigtable/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ public boolean awaitTerminated(Duration timeout) throws InterruptedException {
331331
} catch (ExecutionException e) {
332332
// drainedFuture is only completed via .complete(null), never .completeExceptionally —
333333
// a CancellationException would still be wrapped here. Treat as a bug.
334+
debugTagTracer.record(
335+
TelemetryConfiguration.Level.ERROR, "session_pool_drained_future_failed");
334336
throw new IllegalStateException("drainedFuture failed unexpectedly", e);
335337
} finally {
336338
// Close the watchdog on the way out — drained or timed out, its job is done.

0 commit comments

Comments
 (0)