cloudamqp / lavinmq

Lightweight and fast AMQP (0-9-1) server
https://lavinmq.com
Apache License 2.0
582 stars 33 forks source link

Don't unmap message segments before last consumer is done #825

Open snichme opened 1 day ago

snichme commented 1 day ago

Describe the bug

We have a bug (hard to trigger) that we may unmap message segments before the last consumer deliver loop has finish writing to the socket, causing a segmentation fault.

We should rethink when we do the unmap. Maybe a fiber waiting for all deliver loops to be done (using a WaitGroup).