Page MenuHomePhabricator

[services] Tunnelbroker - Introducing `deleteQueueIfEmpty` method for DeliveryBroker
ClosedPublic

Authored by max on May 23 2022, 5:27 AM.
Tags
None
Referenced Files
F2786868: D4100.id13241.diff
Sat, Sep 21, 2:51 AM
F2786841: D4100.id12999.diff
Sat, Sep 21, 2:24 AM
F2786445: D4100.diff
Sat, Sep 21, 12:31 AM
Unknown Object (File)
Thu, Sep 19, 2:28 PM
Unknown Object (File)
Thu, Sep 19, 2:27 PM
Unknown Object (File)
Thu, Sep 19, 2:27 PM
Unknown Object (File)
Thu, Sep 19, 2:23 PM
Unknown Object (File)
Thu, Sep 19, 2:23 PM

Details

Summary

Following the comment on D3833 introducing the deleteQueueIfEmpty method. The method purpose is if clientDeviceID messages queue is empty we don't
need to store folly::MPMCQueue for it and need to free memory to fix possible 'ghost' queues.

Linear task: ENG-1146

Test Plan

Run yarn run-tunnelbroker-service, service is built and run after.

Diff Detail

Repository
rCOMM Comm
Branch
deleteQueueIfEmpty
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp
69–76

The name of this method explains clearly what happens inside, so I don't think this comment is beneficial here. I would even say that it's harmful, because it describes one specific use case of this method, but the method could be used in a lot of different contexts. I think that a lot better place for this comment is where this method is used - to explain why do we need to call it.

This revision is now accepted and ready to land.May 23 2022, 9:44 AM

The comment was removed to put it in the place where the method is used.

max added inline comments.
services/tunnelbroker/src/DeliveryBroker/DeliveryBroker.cpp
69–76

The name of this method explains clearly what happens inside, so I don't think this comment is beneficial here. I would even say that it's harmful, because it describes one specific use case of this method, but the method could be used in a lot of different contexts. I think that a lot better place for this comment is where this method is used - to explain why do we need to call it.

Not sure about this, but I've removed the comment. Let's put it into the place where it will be used.

max marked an inline comment as done.

Rebase on master.