Skip to content

Commit

Permalink
fix: remove excessive StreamWriter info logging (#1359)
Browse files Browse the repository at this point in the history
Fixing an internal feedback bug: b/202883481
  • Loading branch information
yirutang committed Oct 18, 2021
1 parent 03f9d75 commit 0d27d5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
Expand Up @@ -307,7 +307,7 @@ public void close() {
} finally {
this.lock.unlock();
}
log.info("Waiting for append thread to finish. Stream: " + streamName);
log.fine("Waiting for append thread to finish. Stream: " + streamName);
try {
appendThread.join();
log.info("User close complete. Stream: " + streamName);
Expand Down Expand Up @@ -366,17 +366,17 @@ private void appendLoop() {
}
}

log.info("Cleanup starts. Stream: " + streamName);
log.fine("Cleanup starts. Stream: " + streamName);
// At this point, the waiting queue is drained, so no more requests.
// We can close the stream connection and handle the remaining inflight requests.
this.streamConnection.close();
waitForDoneCallback();

// At this point, there cannot be more callback. It is safe to clean up all inflight requests.
log.info(
log.fine(
"Stream connection is fully closed. Cleaning up inflight requests. Stream: " + streamName);
cleanupInflightRequests();
log.info("Append thread is done. Stream: " + streamName);
log.fine("Append thread is done. Stream: " + streamName);
}

/*
Expand All @@ -396,7 +396,7 @@ private boolean waitingQueueDrained() {
}

private void waitForDoneCallback() {
log.info("Waiting for done callback from stream connection. Stream: " + streamName);
log.fine("Waiting for done callback from stream connection. Stream: " + streamName);
while (true) {
this.lock.lock();
try {
Expand Down Expand Up @@ -441,7 +441,7 @@ private void cleanupInflightRequests() {
} finally {
this.lock.unlock();
}
log.info(
log.fine(
"Cleaning "
+ localQueue.size()
+ " inflight requests with error: "
Expand Down Expand Up @@ -471,7 +471,7 @@ private void requestCallback(AppendRowsResponse response) {
}

private void doneCallback(Throwable finalStatus) {
log.info(
log.fine(
"Received done callback. Stream: "
+ streamName
+ " Final status: "
Expand Down
Expand Up @@ -307,7 +307,7 @@ public void close() {
} finally {
this.lock.unlock();
}
log.info("Waiting for append thread to finish. Stream: " + streamName);
log.fine("Waiting for append thread to finish. Stream: " + streamName);
try {
appendThread.join();
log.info("User close complete. Stream: " + streamName);
Expand Down Expand Up @@ -366,17 +366,17 @@ private void appendLoop() {
}
}

log.info("Cleanup starts. Stream: " + streamName);
log.fine("Cleanup starts. Stream: " + streamName);
// At this point, the waiting queue is drained, so no more requests.
// We can close the stream connection and handle the remaining inflight requests.
this.streamConnection.close();
waitForDoneCallback();

// At this point, there cannot be more callback. It is safe to clean up all inflight requests.
log.info(
log.fine(
"Stream connection is fully closed. Cleaning up inflight requests. Stream: " + streamName);
cleanupInflightRequests();
log.info("Append thread is done. Stream: " + streamName);
log.fine("Append thread is done. Stream: " + streamName);
}

/*
Expand All @@ -396,7 +396,7 @@ private boolean waitingQueueDrained() {
}

private void waitForDoneCallback() {
log.info("Waiting for done callback from stream connection. Stream: " + streamName);
log.fine("Waiting for done callback from stream connection. Stream: " + streamName);
while (true) {
this.lock.lock();
try {
Expand Down Expand Up @@ -441,7 +441,7 @@ private void cleanupInflightRequests() {
} finally {
this.lock.unlock();
}
log.info(
log.fine(
"Cleaning "
+ localQueue.size()
+ " inflight requests with error: "
Expand Down Expand Up @@ -471,7 +471,7 @@ private void requestCallback(AppendRowsResponse response) {
}

private void doneCallback(Throwable finalStatus) {
log.info(
log.fine(
"Received done callback. Stream: "
+ streamName
+ " Final status: "
Expand Down

0 comments on commit 0d27d5a

Please sign in to comment.