Unbounded Write Queue in Boost.MQTT5
- Dominant language
- C++
- Stars
- 207
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
```
using write_queue_t = std::vector;
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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading async_sender.hpp around line 164 and trace publish_send_op::send_publish() through async_send() and do_write(). Reproduce the unreachable-broker flow and determine how queued write_reqs behave; done means the queue cannot grow without bound while publishes remain pending.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100