Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource leak in Beacon tracking #184

Open
mdavidsaver opened this issue May 25, 2022 · 4 comments · May be fixed by #191
Open

Resource leak in Beacon tracking #184

mdavidsaver opened this issue May 25, 2022 · 4 comments · May be fixed by #191
Labels

Comments

@mdavidsaver
Copy link
Member

The m_beaconHandlers map can grow without bound as new PVA servers come online.

/**
* Beacon handler map.
*/
// TODO consider std::unordered_map
typedef std::map<osiSockAddr, BeaconHandler::shared_pointer, comp_osiSock_lt> AddressBeaconHandlerMap;
AddressBeaconHandlerMap m_beaconHandlers;

This map needs to be bounded in size and/or time. (like PVXS does...)

@mdavidsaver
Copy link
Member Author

This may have manifest first with RTEMS because BeaconHandler::_mutex is a far more finite resource on that target.

https://epics.anl.gov/tech-talk/2022/msg00597.php

@mdavidsaver
Copy link
Member Author

mdavidsaver commented May 25, 2022

I remember noticing this before, and also remember fixing it. But apparently I'm getting confused with a similar leak in code tracking TCP connections. cf. f1defe4 fixed in 6.1.0

@kasemir
Copy link
Collaborator

kasemir commented May 25, 2022

What if the client simply ignores beacons? For existing but idle connections, there's already the periodic 'echo' mechanism. For disconnected channels, the search settles to once every ~30 seconds. Detecting beacons from new servers could reduce time to re-connect from those 30 seconds, but after a long disconnect another 30 seconds aren't too bad. So the beacons aren't absolutely necessary, and can in fact cause downtime, as we experienced with CA when clients woke up because of ill-timed beacons, resulting in a lot of search traffic, epics-base/jca#53 .

@mdavidsaver
Copy link
Member Author

What if the client simply ignores beacons?

As I understand things, the only ill effect should be slower reconnects. I usually describe Beacons as an optimization.

@JJL772 JJL772 linked a pull request Oct 25, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants