mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-19 16:15:07 +00:00
The previous implementation based on `delivery_queue` had a serious defect: if receiving a message (`rpc::receive`) blocked, other messages in the queue had to wait. This would cause, for example, `vote_request` messages to stop being handled by a server if the server was in the middle of applying a snapshot. Now `rpc::receive` returns `void`, not `future<>`. Thus we no longer need `delivery_queue`: the network message delivery function can simply call `rpc::receive` directly. Messages which require asynchronous work to be performed (such as snapshot application) are handled in `rpc::receive` by spawning a background task. The number of such background tasks is limited separately for each message type; now if we exceed that limit, we drop other messages of this type (previously they would queue up indefinitely and block not only other messages of this type but different types as well). Message-Id: <20211116163316.129970-1-kbraun@scylladb.com>