Page MenuHomePhabricator

[services] Backup - Blob Get Client - Add initialize
ClosedPublic

Authored by karol on Sep 1 2022, 4:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 28, 2:57 PM
Unknown Object (File)
Thu, Nov 28, 2:55 PM
Unknown Object (File)
Sun, Nov 24, 11:58 PM
Unknown Object (File)
Sun, Nov 24, 8:25 PM
Unknown Object (File)
Sun, Nov 10, 6:57 AM
Unknown Object (File)
Sat, Nov 9, 8:33 AM
Unknown Object (File)
Oct 29 2024, 4:22 PM
Unknown Object (File)
Oct 27 2024, 8:12 PM

Details

Summary

Depends on D5013

Adding initialize function to the blob get client.

Test Plan

backup builds

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested changes to this revision.Sep 5 2022, 5:33 AM
tomek added inline comments.
services/backup/blob_client/src/get_client.rs
64–69

This feels unsafe. What should be the result of is_initialized() after get_client_terminate_cxx?

Can we simplify the logic, so that handling repeated initializations is contained within the if and we exit the function there?

86–88

We can simplify the code by using loop and break

This revision now requires changes to proceed.Sep 5 2022, 5:33 AM
services/backup/blob_client/src/get_client.rs
64–69

This feels unsafe. What should be the result of is_initialized() after get_client_terminate_cxx?

false

Can we simplify the logic, so that handling repeated initializations is contained within the if and we exit the function there?

I wouldn't suppress such an action. Re-initialization was introduced in order to simplify the code in c++, so we don't have to call terminate explicitly every time. This function (initialize) therefore stands for initialization/re-initialization. I don't know, I feel pretty good about this, could you specify what exactly is unsafe here? Or any "real" arguments against the current solution?

86–88

yes, right

tomek added inline comments.
services/backup/blob_client/src/get_client.rs
85–102 ↗(On Diff #16352)

Maybe we can simplify this even further by using while let which would match against data from response?

64–69

Ok, that makes sense.

This revision is now accepted and ready to land.Sep 7 2022, 5:11 AM
services/backup/blob_client/src/get_client.rs
85–102 ↗(On Diff #16352)

That is ok but we'd not have error message available when using while let

This revision was landed with ongoing or failed builds.Sep 8 2022, 4:10 AM
This revision was automatically updated to reflect the committed changes.