Skip to content

Unbounded Write Queue in Boost.MQTT5 #53

Description

@Th-Wilczek-Resuscitec
using write_queue_t = std::vector<write_req, queue_allocator_type>;
write_queue_t _write_queue;  // NO MAXIMUM SIZE LIMIT

Every async_publish call adds a write_req to this queue. Each write_req holds:

  • A const_buffer to the serialized MQTT PUBLISH packet (payload data)
  • A completion handler (captures topic string)

Flow When Broker Is Unreachable

  1. async_publish → publish_send_op::send_publish() → async_send() → _write_queue.emplace_back() (line 164 of async_sender.hpp)
  2. do_write() calls _svc._stream.async_write()
  3. TCP async_write hangs (does not fail immediately when broker is unreachable — socket is in connecting/limbo state)
  4. write_reqs accumulate in _write_queue
  5. queue grows unbounded → OOM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions