cluster/zeromq: No assert on inproc handling

This might happen if we didn't succeed in completely sending a multipart
message and stop early.
This commit is contained in:
Arne Welzel 2025-02-06 15:35:58 +01:00
parent aad512c616
commit 8a1abfa8ef

View file

@ -405,11 +405,10 @@ void ZeroMQBackend::Run() {
// Forward messages from the inprocess bridge to XSUB for subscription // Forward messages from the inprocess bridge to XSUB for subscription
// subscription handling (1 part) or XPUB for publishing (4 parts). // subscription handling (1 part) or XPUB for publishing (4 parts).
for ( auto& msg : msgs ) { for ( auto& msg : msgs ) {
assert(msg.size() == 1 || msg.size() == 4);
if ( msg.size() == 1 ) { if ( msg.size() == 1 ) {
xsub.send(msg[0], zmq::send_flags::none); xsub.send(msg[0], zmq::send_flags::none);
} }
else { else if ( msg.size() == 4 ) {
for ( auto& part : msg ) { for ( auto& part : msg ) {
zmq::send_flags flags = zmq::send_flags::dontwait; zmq::send_flags flags = zmq::send_flags::dontwait;
if ( part.more() ) if ( part.more() )
@ -447,6 +446,9 @@ void ZeroMQBackend::Run() {
} while ( ! result ); } while ( ! result );
} }
} }
else {
ZEROMQ_THREAD_PRINTF("inproc: error: expected 1 or 4 parts, have %zu!\n", msg.size());
}
} }
}; };