From 745ceb46dec5922efe394773028532dcd84a4f9b Mon Sep 17 00:00:00 2001 From: Yiru Tang Date: Thu, 22 Sep 2022 12:58:48 -0700 Subject: [PATCH] feat: add two fine logs that would allow Datastream to look into the stuck issue (#1791) --- .../cloud/bigquery/storage/v1/ConnectionWorker.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java index 0b75813fa8..1fbbe94090 100644 --- a/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java +++ b/google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java @@ -488,6 +488,12 @@ private void appendLoop() { // TODO: Handle NOT_ENOUGH_QUOTA. // In the close case, the request is in the inflight queue, and will either be returned // to the user with an error, or will be resent. + log.fine( + "Sending " + + originalRequestBuilder.getProtoRows().getRows().getSerializedRowsCount() + + " rows to stream '" + + originalRequestBuilder.getWriteStream() + + "'"); this.streamConnection.send(originalRequestBuilder.build()); } } @@ -580,6 +586,13 @@ private void cleanupInflightRequests() { } private void requestCallback(AppendRowsResponse response) { + log.fine( + "Got response on stream '" + + response.getWriteStream() + + "' " + + (response.hasError() + ? "error: " + response.getError() + : "offset: " + response.getAppendResult().getOffset().getValue())); AppendRequestAndResponse requestWrapper; this.lock.lock(); if (response.hasUpdatedSchema()) {