Page MenuHomePhabricator

[DRAFT] [services] Backup - Connect to Blob - Use Result
AbandonedPublic

Authored by karol on Aug 24 2022, 5:57 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 17, 11:57 PM
Unknown Object (File)
Thu, Jun 13, 9:46 PM
Unknown Object (File)
Wed, Jun 12, 8:00 PM
Unknown Object (File)
Sun, May 26, 7:53 PM
Unknown Object (File)
Sun, May 26, 7:53 PM
Unknown Object (File)
Sun, May 26, 7:52 PM
Unknown Object (File)
Sun, May 26, 7:49 PM
Unknown Object (File)
May 16 2024, 6:13 AM

Details

Summary

Depends on D4944

I discovered that I can just use Result in Rust and catch std::exception in c++

Test Plan

Test plan in D4946

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

karol retitled this revision from [services] Backup - Connect to Blob - Use Result to [DRAFT] [services] Backup - Connect to Blob - Use Result.Aug 24 2022, 6:04 AM
karol edited the summary of this revision. (Show Details)
karol edited the test plan for this revision. (Show Details)
karol added reviewers: varun, tomek.
tomek requested changes to this revision.Aug 29 2022, 4:59 AM
tomek added inline comments.
services/backup/blob_client/src/put_client.rs
114 ↗(On Diff #15922)

Why do we assign here? Can't we just return the value? https://docs.rs/tokio/latest/tokio/runtime/struct.Runtime.html#method.block_on

This runs the given future on the current thread, blocking until it is complete, and yielding its resolved result.

149 ↗(On Diff #15922)

Why this function doesn't need to call check_error?

This revision now requires changes to proceed.Aug 29 2022, 4:59 AM

update

services/backup/blob_client/src/put_client.rs
114 ↗(On Diff #15922)

This is nice, but we should assign since we have to reassign client.rx in the end eventually. So, if we wanted to return from the block_on, we'd have to have an internal variable in the async block anyway.

149 ↗(On Diff #15922)

It should call it

Abandoning this stack in favor of the new one that starts @ D5002.

All the comments have been either addressed inline or in the new stack.