From a5b4529f9cf7fb229c72abbd4c2fdd1b8069a883 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Tue, 13 Oct 2026 12:51:34 +0200 Subject: [PATCH] ZeroMQ pusher: say so when a stalled writer switches the socket to dropping A send that blocked for over a second drops that image and turns the socket non-blocking for the rest of the run, so every later image that finds the queue full is dropped too - without a word in the log. Log the moment it happens, once per run, with the image number. Co-Authored-By: Claude Fable 5.1 --- image_pusher/ZMQStream2PusherSocket.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/image_pusher/ZMQStream2PusherSocket.cpp b/image_pusher/ZMQStream2PusherSocket.cpp index 2b9334a97..64475b649 100644 --- a/image_pusher/ZMQStream2PusherSocket.cpp +++ b/image_pusher/ZMQStream2PusherSocket.cpp @@ -3,6 +3,8 @@ #include "ZMQStream2PusherSocket.h" +#include + void zmq_socket_free(void *data, void *hint) { auto z = (ZeroCopyReturnValue *) hint; z->release(); @@ -56,6 +58,10 @@ void ZMQStream2PusherSocket::WriterThread() { // When hitting timeout on SendZeroCopy consider it a transmission error and switch to non-blocking communication bool blocking_send = !transmission_error; if (!s.SendZeroCopy(e.z->GetImage(), e.z->GetImageSize(), zmq_socket_free, e.z, blocking_send)) { + if (!transmission_error) + spdlog::warn("ZeroMQ image socket {}: send blocked for over a second - image {} dropped, and " + "images that find the queue full are dropped for the rest of the run", + s.GetEndpointName(), e.z->GetImageNumber()); transmission_error = true; // The slot is already released: on a failed send SendZeroCopy closes the message, and // closing a zmq_msg_init_data message runs its free function (zmq_socket_free).