You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I little confused about how mechanism restricting amount of inflight messages implemented in mosquitto client library.
When someone publishes message to mosquitto client - it queued with some state - waiting for acknowledgment or invalid, depending on max inflight messages policy and current inflight messages count. When max inflight messages set to 0 then all incoming messages marked as waiting for acknowledgment, and no invalid messages possible in queue. It's OK for me. I don't understand handling of received acknowledgments - it checks queue looking for invalid messages, (to schedule such messages for writing), even if no such messages possible in queue.
It doesn't beat the logic, but looks like some extra work: in case if max inflight messages is unlimited, it will iterate over whole queue of messages again and again, doing nothing useful (because cur->state == mosq_ms_invalid is never true in case when mosq->max_inflight_messages == 0).
This extra work executed under out_messages-mutex lock, so queueing of new messages blocked. I suggest following:
I little confused about how mechanism restricting amount of inflight messages implemented in mosquitto client library.
When someone publishes message to mosquitto client - it queued with some state -
waiting for acknowledgment
orinvalid
, depending on max inflight messages policy and current inflight messages count. When max inflight messages set to 0 then all incoming messages marked aswaiting for acknowledgment
, and noinvalid
messages possible in queue. It's OK for me. I don't understand handling of received acknowledgments - it checks queue looking forinvalid
messages, (to schedule such messages for writing), even if no such messages possible in queue.lib/messages_mosq.c:251 _mosquitto_message_remove()
It doesn't beat the logic, but looks like some extra work: in case if max inflight messages is unlimited, it will iterate over whole queue of messages again and again, doing nothing useful (because
cur->state == mosq_ms_invalid
is nevertrue
in case whenmosq->max_inflight_messages == 0
).This extra work executed under
out_messages
-mutex lock, so queueing of new messages blocked. I suggest following:The text was updated successfully, but these errors were encountered: