Page MenuHomePhabricator

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

Authored by max on May 23 2022, 5:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 1:46 PM
Unknown Object (File)
Mon, Nov 18, 10:54 AM
Unknown Object (File)
Mon, Nov 11, 6:55 AM
Unknown Object (File)
Sun, Nov 3, 3:18 PM
Unknown Object (File)
Oct 25 2024, 12:06 AM
Unknown Object (File)
Oct 25 2024, 12:06 AM
Unknown Object (File)
Oct 25 2024, 12:06 AM
Unknown Object (File)
Oct 8 2024, 1:06 AM

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 ↗(On Diff #12999)

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 ↗(On Diff #12999)

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.