Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces queue bounding and fast-fail mechanisms to the SessionPoolImpl when consecutive session establishment failures occur or when the pending RPC queue exceeds its maximum capacity. Feedback on these changes highlights two potential issues: first, if lastCloseStatus is OK, rejecting the RPC with an OK status could lead to silent failures, so it should be defensively mapped to UNAVAILABLE; second, trailers can occasionally be null in gRPC, so a defensive null check should be added when assigning lastCloseTrailers to prevent null pointer issues.
81131c3 to
c6ec691
Compare
…secutive failures # Conflicts: # java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/PoolSizerTest.java # Conflicts: # java-bigtable/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImplTest.java
…l has no established sessions
…block in onSessionClose
c6ec691 to
54bb35c
Compare
| private int consecutiveFailures = 0; | ||
|
|
||
| @GuardedBy("poolLock") | ||
| private Status lastCloseStatus = Status.UNAVAILABLE; |
There was a problem hiding this comment.
should this be null?
| handle.getSession().close(closeReq); | ||
| } | ||
| } else if (poolState == PoolState.STARTED) { | ||
| if (isFailingWithNoEstablishedSessions()) { |
There was a problem hiding this comment.
is this the right place for this check? this is the listener for client config udpates, is this the right place to pop closable RPCs? Also, client configuration responses arrives every 5 minutes. So it's longer interval then normal vrpcs deadline.
| afterRelease(handle); | ||
| toBeClosed = afterRelease(handle); | ||
| if (!toBeClosed.isEmpty()) { | ||
| closeResult = createConsecutiveFailureResult(lastCloseStatus, lastCloseTrailers); |
There was a problem hiding this comment.
why does this mean consecutiveFailure?
| afterRelease(handle); | ||
| toBeClosed = afterRelease(handle); | ||
| if (!toBeClosed.isEmpty()) { | ||
| closeResult = createConsecutiveFailureResult(lastCloseStatus, lastCloseTrailers); |
There was a problem hiding this comment.
same question here.
Part 1 of 2 for b/584671437.
What changed
SessionPoolImpl, failpendingRpcsonconsecutiveFailures >= consecutive_session_failure_thresholdif and only if the pool has no established (READYorIN_USE) sessions (readyCount + inUseCount == 0).onSessionClose()(draining queuedpendingRpcswhen transitioning to 0 established sessions whileconsecutiveFailures >= threshold, while preservingpendingRpcswheninUseCount > 0) andPendingVRpc.start()(rejecting new calls during the 60sSessionCreationBudgetlockout when no sessions are closing).