Skip to content
Permalink
Browse files
fix: remove excessive StreamWriter info logging (#1359)
Fixing an internal feedback bug: b/202883481
  • Loading branch information
yirutang committed Oct 18, 2021
1 parent 03f9d75 commit 0d27d5a10ad62d506a646dcbf0a196e1d57740b0
@@ -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);
@@ -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);
}

/*
@@ -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 {
@@ -441,7 +441,7 @@ private void cleanupInflightRequests() {
} finally {
this.lock.unlock();
}
log.info(
log.fine(
"Cleaning "
+ localQueue.size()
+ " inflight requests with error: "
@@ -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: "
@@ -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);
@@ -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);
}

/*
@@ -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 {
@@ -441,7 +441,7 @@ private void cleanupInflightRequests() {
} finally {
this.lock.unlock();
}
log.info(
log.fine(
"Cleaning "
+ localQueue.size()
+ " inflight requests with error: "
@@ -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: "

0 comments on commit 0d27d5a

Please sign in to comment.