feat: Resumable Media Upload functionality implementation - #72
viacheslav-rostovtsev wants to merge 18 commits into
Conversation
5fba3ab to
6ed4c33
Compare
| end | ||
| return [remaining, retry_policy.timeout].min if retry_policy&.timeout | ||
|
|
||
| remaining |
There was a problem hiding this comment.
If I'm reading this right, remaining starts at the deadline set in run (by default BASE_TIMEOUT = 3_600, longer for large files, per resolve_timeout) and counts down from there. When retry_policy comes from CONTROL_PLANE_DEFAULTS/DATA_PLANE_DEFAULTS, which don't pass a timeout:, RetryPolicy#timeout falls back to DEFAULT_TIMEOUT (3600), so the cap on line 378 only brings it down to an hour.
Thus a single stalled request can block for up to an hour. Whenever the upload has an hour or less left, which is always the case for uploads under 3.5 GiB, it could fail with DeadlineExceededError instead of entering :recovery. Is that intended, or should a stalled request get a timeout short enough to enter :recovery?
There was a problem hiding this comment.
This is intended for now. There is a timeout pass coming when I implement the stall control protocol -- the timeouts will change for both stall control and the default-timeout versions.
Public API `Gapic::Rest::ResumableUpload::Session` is the entry point. `Session#run` for initial upload, and `Session#resume` for resuming after error. Also public: `Progress`, `ResumeHandle`, `HasResumeHandle` module, and a typed error hierarchy. Changes to existing files: * `StubLogger#warn` * request-payload abridging in `ClientStub` so that binary upload bodies don't land in logs * `REST_ERROR_PREFIX` constant extracted in Rest::Error Integration testing against Showcase, for manual confirmation (disabled in CI). CI integration tests are planned to land in the generator.
…rim public surface
…replacement Show the coordinator alongside the driver in the architecture and test-plan diagrams.
…ble in driver_test Replaces the core.instance_variable_set poke with a Core double passed through the designed test seam.
…ries from it Comparing readers against a pristine policy dropped a caller's setting whenever it happened to equal the library default. #overrides reports only what was explicitly supplied, so start_retry_policy_for collapses to a merge and BACKOFF_DEFAULTS goes away.
…retry predicate Only the call timeout is now imposed unconditionally; every other setting the caller carries, including a retry predicate, reaches the initiation policy.
…ator A Showcase test that builds a Driver by hand exercises a path no generated client takes. All five suites now drive ::Gapic::ResumableUpload, build_config is gone, and the golden path gains a decode-into-a-message case.
… be BadResponseError
…ror` can be raised.
…ot intended to be public as `@private`
48045ab to
8a1ff50
Compare
Resumable Media Upload functionality
Public API
Gapic::Rest::ResumableUpload::Sessionis the entry point.Session#startfor initial upload, andSession#resumefor resuming after error.Also public:
Progress,ResumeHandle,HasResumeHandlemodule, and a typed error hierarchy.Changes to existing files:
StubLogger#warnClientStubso that binary upload bodies don't land in logsREST_ERROR_PREFIXconstant extracted in Rest::ErrorIntegration testing