Skip to content

Commit

Permalink
fix: Reduce the timeout to 5 minutes for the requests wait time in qu…
Browse files Browse the repository at this point in the history
…eue.

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
  • Loading branch information
GaoleMeng committed Apr 22, 2023
1 parent ea2e8fb commit affa11a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ConnectionWorker implements AutoCloseable {
* We will constantly checking how much time we have been waiting for the next request callback
* if we wait too much time we will start shutting down the connections and clean up the queues.
*/
static Duration MAXIMUM_REQUEST_CALLBACK_WAIT_TIME = Duration.ofMinutes(15);
static Duration MAXIMUM_REQUEST_CALLBACK_WAIT_TIME = Duration.ofMinutes(5);

private Lock lock;
private Condition hasMessageInWaitingQueue;
Expand Down Expand Up @@ -321,7 +321,7 @@ public void run() {
}

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

/** Schedules the writing of rows at given offset. */
Expand Down

0 comments on commit affa11a

Please sign in to comment.