Page MenuHomePhabricator

[services] Backup/Blob - Add terminateCallback
ClosedPublic

Authored by karol on Mar 30 2022, 5:03 AM.
Tags
None
Referenced Files
F3355041: D3560.id11156.diff
Sat, Nov 23, 1:56 PM
F3353929: D3560.diff
Sat, Nov 23, 11:35 AM
Unknown Object (File)
Sun, Nov 17, 8:25 PM
Unknown Object (File)
Wed, Nov 13, 11:43 AM
Unknown Object (File)
Wed, Nov 13, 11:25 AM
Unknown Object (File)
Tue, Nov 5, 5:55 PM
Unknown Object (File)
Thu, Oct 31, 11:21 PM
Unknown Object (File)
Thu, Oct 31, 9:27 PM

Details

Summary

Depends on D3559

We want to add an additional callback that will be executed before the connection ends but after we are done with the communication.

From now on we will have two "ending" callbacks:

  • doneCallback - this is executed after the connection ends and there will be no more grpc operations in the current context
  • terminateCallback - this is executed when we're done with the communication but we have not yet closed the connection

The reason to introduce the termination callback is that I needed to wait until the backup client work is done before I closed the connection from backup with the client. Having this, we are able to tell when the whole backup operation is done, without it we only knew when the communication between the client and the backup was done(plus the chunks were sent to the blob but we wouldn't know what happened to them after that).

Test Plan
cd services
yarn run-backup-service

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h
91 ↗(On Diff #10811)

What changed in this diff which made it possible to avoid try-catch here?

This revision is now accepted and ready to land.Apr 1 2022, 4:54 AM

In theory, one of these could be a destructor, but having a callback is probably more maintainable

services/blob/src/Reactors/server/base-reactors/ServerWriteReactorBase.h
91 ↗(On Diff #10811)

It was redundant because the entire block of NextWrite is wrapped in try ... catch