Page MenuHomePhabricator

[services] Backup/Blob - Add terminateCallback
ClosedPublic

Authored by karol on Mar 30 2022, 5:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 20, 4:04 PM
Unknown Object (File)
Fri, Dec 20, 4:04 PM
Unknown Object (File)
Fri, Dec 20, 4:04 PM
Unknown Object (File)
Fri, Dec 20, 4:00 PM
Unknown Object (File)
Wed, Nov 27, 7:44 AM
Unknown Object (File)
Nov 23 2024, 1:56 PM
Unknown Object (File)
Nov 23 2024, 11:35 AM
Unknown Object (File)
Nov 17 2024, 8:25 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