Page MenuHomePhabricator

[services] Backup - client reactors - distinguish terminated from done
ClosedPublic

Authored by karol on Apr 13 2022, 7:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 2:34 PM
Unknown Object (File)
Fri, Dec 20, 2:34 PM
Unknown Object (File)
Fri, Dec 20, 2:34 PM
Unknown Object (File)
Fri, Dec 20, 2:34 PM
Unknown Object (File)
Fri, Dec 20, 2:30 PM
Unknown Object (File)
Wed, Dec 11, 8:49 AM
Unknown Object (File)
Wed, Nov 27, 8:30 AM
Unknown Object (File)
Wed, Nov 27, 6:13 AM

Details

Summary

Depends on D3664

We need to separate two pieces of information: when the reactor is terminated and when it is "done".

  • terminated - this means that there are no more operations defined by the user
  • done - this means that there will be no more gRPC operations performed for this reactor (all of 'em are done)

Thing is, gRPC does some finalizing operations after we terminate a reactor.

Test Plan
cd services
yarn run-backup-service

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek requested changes to this revision.Apr 15 2022, 9:45 AM
tomek added inline comments.
services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h
114–115 ↗(On Diff #11417)

What is the relationship between terminated and done? Based on the summary it looks like a reactor should never be done and not terminated. Is that the case? Should we change this code

This revision now requires changes to proceed.Apr 15 2022, 9:45 AM

What do you think about adding a state which can be RUNNING, TERMINATED and DONE? Maybe it will make this code more maintainable.

In D3719#103333, @palys-swm wrote:

What do you think about adding a state which can be RUNNING, TERMINATED and DONE? Maybe it will make this code more maintainable.

Good idea

services/backup/docker-server/contents/server/src/Reactors/client/base-reactors/ClientBidiReactorBase.h
114–115 ↗(On Diff #11417)

Yes

karol edited the summary of this revision. (Show Details)

modify done after calling terminate

In D3719#103333, @palys-swm wrote:

What do you think about adding a state which can be RUNNING, TERMINATED and DONE? Maybe it will make this code more maintainable.

I implemented this in D3785 D3786 D3787 D3788 D3789

I know we talked about this that rebasing is better if it's not yet landed but in this case I think having it implemented separately is better because it fits better in that task and also this applies to all reactors not only the ones here. I hope you understnad.

In D3719#104588, @karol-bisztyga wrote:
In D3719#103333, @palys-swm wrote:

What do you think about adding a state which can be RUNNING, TERMINATED and DONE? Maybe it will make this code more maintainable.

I implemented this in D3785 D3786 D3787 D3788 D3789

I know we talked about this that rebasing is better if it's not yet landed but in this case I think having it implemented separately is better because it fits better in that task and also this applies to all reactors not only the ones here. I hope you understnad.

Thanks for implementing this! So the code that is introduced here is replaced by what is in that stack? Can we then abandon this diff?
But overall, it makes sense to do such a big refactoring in a separate place.

This revision is now accepted and ready to land.Apr 20 2022, 7:24 AM

I think we can safely land this with no harm done.

I think we can safely land this with no harm done.

This is a really bad pattern and a great example of behavior that is costly for your reviewer. You should not be submitting useless diffs to people that get overwritten by later diffs... and a reviewer should never be in a position of asking about something that gets addressed in a later diff.

Instead, the stack should have been rebased, with this diff updated with the corrected approach.

This is my number one piece of feedback to you, @karol-bisztyga – you need to move away from making commits as if you're on a solo project, and treating diffs as "here are some commits I made today"... and instead think of the stack you're trying to create, and to build your commits around a clean stack that is easy to review.

Simpler framing: we need a lot fewer diffs from you, and a lot more rebasing.