Skip to content

Commit 827b22d

Browse files
committed
docs(gax-grpc): explain use of == for log threshold
1 parent de28aef commit 827b22d

File tree

1 file changed

+2
-0
lines changed
  • sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc

1 file changed

+2
-0
lines changed

sdk-platform-java/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ void resize() {
338338
consecutiveResizes = 0;
339339
}
340340

341+
// Log warning only once when the threshold is reached to avoid spamming logs.
342+
// Using == instead of >= ensures we don't log on every subsequent resize cycle.
341343
if (consecutiveResizes == CONSECUTIVE_RESIZE_THRESHOLD) {
342344
LOG.warning(
343345
"Channel pool is repeatedly resizing. Consider adjusting `initialChannelCount` or `maxResizeDelta` to a more reasonable value. "

0 commit comments

Comments
 (0)