mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2026-11-25 21:21:37 +00:00
fix(zeromq,shmem): stop socket monitor before closing sockets
- Stop the zmq monitor and drain pending events before closing the monitored socket and the reading monitor socket - Events emitted while the monitored socket closes were dropped by libzmq, leaking their endpoint frames (zmq_msg_init_size) - Apply to both the zeromq and shmem transport sockets - LeakSanitizer no longer reports leaks in the test suite Fixes: #463 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -320,17 +320,14 @@ class Socket final : public fair::mq::Socket
|
||||
{
|
||||
// LOG(debug) << "Closing socket " << fId;
|
||||
|
||||
zmq::closeMonitorSocket(fSocket, fMonitorSocket);
|
||||
fMonitorSocket = nullptr;
|
||||
|
||||
if (fSocket && zmq_close(fSocket) != 0) {
|
||||
LOG(error) << "Failed closing data socket " << fId
|
||||
<< ", reason: " << zmq_strerror(errno);
|
||||
}
|
||||
fSocket = nullptr;
|
||||
|
||||
if (fMonitorSocket && zmq_close(fMonitorSocket) != 0) {
|
||||
LOG(error) << "Failed closing monitor socket " << fId
|
||||
<< ", reason: " << zmq_strerror(errno);
|
||||
}
|
||||
fMonitorSocket = nullptr;
|
||||
}
|
||||
|
||||
void SetOption(const std::string& option, const void* value, size_t valueSize) override
|
||||
|
||||
Reference in New Issue
Block a user