Skip to content

Commit 830c1b0

Browse files
committed
fix: Reduce the timeout to 3 minutes for the requests wait time in queue.
Since in write api server side we have total timeout of 2 minutes, it does not make sense to wait 15 minutes to determine whether we have met dead connection, let's reduce the timeout here
1 parent ea2e8fb commit 830c1b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1/ConnectionWorker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class ConnectionWorker implements AutoCloseable {
7575
* We will constantly checking how much time we have been waiting for the next request callback
7676
* if we wait too much time we will start shutting down the connections and clean up the queues.
7777
*/
78-
static Duration MAXIMUM_REQUEST_CALLBACK_WAIT_TIME = Duration.ofMinutes(15);
78+
static Duration MAXIMUM_REQUEST_CALLBACK_WAIT_TIME = Duration.ofMinutes(3);
7979

8080
private Lock lock;
8181
private Condition hasMessageInWaitingQueue;
@@ -321,7 +321,7 @@ public void run() {
321321
}
322322

323323
private void resetConnection() {
324-
log.info("Reconnecting for stream:" + streamName + " id: " + writerId);
324+
log.info("Start connecting stream: " + streamName + " id: " + writerId);
325325
if (this.streamConnection != null) {
326326
// It's safe to directly close the previous connection as the in flight messages
327327
// will be picked up by the next connection.
@@ -344,7 +344,7 @@ public void run(Throwable finalStatus) {
344344
doneCallback(finalStatus);
345345
}
346346
});
347-
log.info("Reconnect done for stream:" + streamName + " id: " + writerId);
347+
log.info("Finish connecting stream: " + streamName + " id: " + writerId);
348348
}
349349

350350
/** Schedules the writing of rows at given offset. */

0 commit comments

Comments
 (0)