Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces cooperative cancellation support for synchronous REST operations by adding a copyable RestCancellation handle and RestCancellationOption. It integrates cancellation checks into CurlImpl (using libcurl progress callbacks and a 50ms polling interval), the REST retry loop, backoff mechanisms, and Storage operations (bypassing read hedging). The reviewer feedback highlights opportunities to optimize performance and style by using get_optional on Options to avoid redundant map lookups in RestCancellationWait, IsRestCancelled, and CurlImpl, and suggests directly including the <optional> header in rest_cancellation.h.
|
/gcbrun |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16663 +/- ##
========================================
Coverage 92.62% 92.63%
========================================
Files 2271 2274 +3
Lines 224597 225163 +566
========================================
+ Hits 208032 208573 +541
- Misses 16565 16590 +25 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Synchronous REST requests cannot currently be cancelled while an SDK call is blocked. Checking an application cancellation flag between calls or disabling retries does not interrupt an active request, so an application can remain blocked waiting for the server or a timeout.
Add an experimental
RestCancellationhandle andRestCancellationOptionfor per-call options, includingstorage::Clientoperations and streams. Another thread can request cancellation, interrupting libcurl waits, preventing further retries, and reportingkCancelledthrough existing result or stream-error mechanisms. Streams retain cancellation state throughout their lifetime, and cancelled upload cleanup avoids finalizing buffered partial data.Cancellable requests use bounded polling without accessing libcurl handles from another thread. Cancellable Storage reads bypass hedging so queued workers cannot delay cancellation. Credential acquisition already in progress remains outside this scope, and cancellation does not roll back operations the server has already committed.