fix: update local vRPC status to match the last session failure when … · googleapis/java-bigtable@261ed95 (original) (raw)
This repository was archived by the owner on May 8, 2026. It is now read-only.
File tree
- google-cloud-bigtable/src
- main/java/com/google/cloud/bigtable/data/v2/internal/session
- test/java/com/google/cloud/bigtable/data/v2/internal/session
| Original file line number |
Diff line number |
Diff line change |
| @@ -507,11 +507,12 @@ private void onSessionClose( |
|
|
| 507 |
507 |
// vRPCs failing with consecutive failures should fail |
| 508 |
508 |
VRpcResult result = |
| 509 |
509 |
VRpcResult.createRejectedError( |
| 510 |
|
-Status.UNAVAILABLE.withDescription( |
| 511 |
|
-String.format( |
| 512 |
|
-"Session failed with consecutive failures. Most recent server status: %s," |
| 513 |
|
- + " metadata: %s.", |
| 514 |
|
-status, trailers))); |
|
510 |
+Status.fromCode(status.getCode()) |
|
511 |
+ .withDescription( |
|
512 |
+String.format( |
|
513 |
+"Session failed with consecutive failures. Most recent server status: %s," |
|
514 |
+ + " metadata: %s.", |
|
515 |
+status, trailers))); |
| 515 |
516 |
for (PendingVRpc vrpc : toBeClosed) { |
| 516 |
517 |
try { |
| 517 |
518 |
vrpc.getListener().onClose(result); |
| Original file line number |
Diff line number |
Diff line change |
| @@ -206,7 +206,7 @@ public void consecutiveFailuresTest() { |
|
|
| 206 |
206 |
assertThat(exception) |
| 207 |
207 |
.hasMessageThat() |
| 208 |
208 |
.contains( |
| 209 |
|
-"UNAVAILABLE: Session failed with consecutive failures. Most recent server status:" |
|
209 |
+"INTERNAL: Session failed with consecutive failures. Most recent server status:" |
| 210 |
210 |
+ " Status{code=INTERNAL, description=fake internal error. PeerInfo:" |
| 211 |
211 |
+ " transport_type: TRANSPORT_TYPE_SESSION_UNKNOWN, cause=null}"); |
| 212 |
212 |
} |