dragonflydb / dragonflydb/dragonfly

dispatch queue back-pressure and deadlock

Open
#3,035 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
C++
Stars
31.6k
Forks
1.3k
Avg merge
1d 10h
Merged PRs (30d)
137

Description

dispatch queue can deadlock:

* if a pubsub connection both publishes and subscribes to the same channel and sends multiple messages that the queue is:
` Publish <----- Publish <----- Publish <-----` ends up `Publish <----- SendPubMessage <----- SendPubMessage <----- SendPubMessage` and deadlocks because the top message `Publish` now will block on `EnsureBelowLimit`.

* If intrusive messages populate the queue recursively nonstop then the rest of the queue will starve

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Begin by reproducing the pubsub scenario where Publish and SendPubMessage deadlock under queue back-pressure, then investigate the recursive intrusive-message case; done means neither deadlocks nor starves the rest of the dispatch queue.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.