feat(GCS+gRPC): more efficient WriteObject() stall timeouts#9576
Conversation
This changes the implementation of `WriteObject()` to use the blocking API and a watchdog timer to implement stall timeouts. If the timer expires before the `Write()` operation completes a background thread cancels the RPC. If the operation completes, we cancel the timer.
|
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov Report
@@ Coverage Diff @@
## main #9576 +/- ##
=======================================
Coverage 94.37% 94.37%
=======================================
Files 1491 1491
Lines 137590 137590
=======================================
Hits 129844 129844
Misses 7746 7746 Continue to review full report at Codecov.
|
| grpc::WriteOptions().set_last_message()); | ||
| watchdog.cancel(); | ||
| if (watchdog.get()) { | ||
| writer->Close(); |
There was a problem hiding this comment.
do we need another watchdog that might cancel this Close() operation? we use one a few lines below here.
There was a problem hiding this comment.
No. If we get to this point the streaming RPC is already canceled. Setting up another watchdog, just to cancel the request again seems unlikely to speed up things.
This changes the implementation of
WriteObject()to use the blockingAPI and a watchdog timer to implement stall timeouts. If the timer
expires before the
Write()operation completes a background threadcancels the RPC. If the operation completes, we cancel the timer.
Fixes #9558
This change is