Page MenuHomePhabricator

[services] Backup - Blob Put Client - Add write
ClosedPublic

Authored by karol on Sep 1 2022, 4:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jun 22, 10:00 AM
Unknown Object (File)
Sat, Jun 22, 9:22 AM
Unknown Object (File)
Fri, Jun 21, 4:45 AM
Unknown Object (File)
Fri, Jun 14, 5:14 AM
Unknown Object (File)
Thu, Jun 13, 8:03 AM
Unknown Object (File)
Tue, Jun 4, 12:43 PM
Unknown Object (File)
Sun, Jun 2, 3:43 AM
Unknown Object (File)
Wed, May 29, 11:12 AM

Details

Summary

Depends on D5010

Adding write function to the blob put client.

Test Plan

backup builds

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jon requested changes to this revision.Sep 1 2022, 8:53 AM
jon added inline comments.
services/backup/blob_client/src/put_client.rs
228 ↗(On Diff #16171)

I really don't like this usage of a global variable to check some implicit global mutable state.

Why do we need to check for errors here? and is here really where we want to address errors inside of a put call?

250 ↗(On Diff #16171)

report_error should really take a &str, so we don't have to do heap allocation from the callee.

This revision now requires changes to proceed.Sep 1 2022, 8:53 AM
karol added inline comments.
services/backup/blob_client/src/put_client.rs
228 ↗(On Diff #16171)

I realize you're not a fan of the solution I created for handling errors in the async functions but one place to discuss this in the stack should be enough https://phab.comm.dev/D5005#146417

250 ↗(On Diff #16171)

Yes, definitely, it is fixed later in the stack D5030

tomek requested changes to this revision.Sep 5 2022, 5:19 AM
tomek added inline comments.
services/backup/blob_client/src/put_client.rs
234–248 ↗(On Diff #16171)

Is there a way to avoid this pattern?

if let Some(client) = (*maybe_client).take() {
...
  *maybe_client = Some(client);
}
250 ↗(On Diff #16171)

When a diff that introduced something is still open, we should prefer fixing there instead of creating a followup diff. A reasonable reason for not following this rule is really expensive rebase, but I don't expect something like that in this case.

256 ↗(On Diff #16171)

Returning Ok when we had an error doesn't sound perfect.

This revision now requires changes to proceed.Sep 5 2022, 5:19 AM
services/backup/blob_client/src/put_client.rs
234–248 ↗(On Diff #16171)

Ok, now I see this is going to be questioned in every diff. Ok then, I'm going to create a task for this: https://linear.app/comm/issue/ENG-1736/try-to-avoid-reassigning-when-modifying-the-field-of-a-global-struct

256 ↗(On Diff #16171)

Gonna change, thanks.

tomek added inline comments.
services/backup/blob_client/src/put_client.rs
234–248 ↗(On Diff #16171)

Yeah, I've mentioned this in a couple of places to make it easier to remember about addressing this in all relevant places. We can discuss it wherever you prefer.

I agree with @tomek, I would really like to see the diff not introduce things that need to be addressed, and then have a diff later address it.

We should probably have done more "foundation" work on logging and other canonical practices before creating such a large stack of "needing to be addressed concerns"

This revision is now accepted and ready to land.Sep 7 2022, 10:42 AM

We should probably have done more "foundation" work on logging and other canonical practices before creating such a large stack of "needing to be addressed concerns"

I asked about such a thing in the rust comm channel some time ago and didn't really get any precise answers. This is why I also thought it'd be better for one person to really work out the rust stuff first, then such things as logging would be available for others from the start.

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.