apache / apache/pulsar

[Bug] Deadlock in SystemTopicBasedTopicPoliciesService in TopicsConsumerImplTest

Open
#23,543 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Read release policy

- [X] I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

### Version

master branch

### Minimal reproduce step

Happened in https://github.com/apache/pulsar/actions/runs/11631141771/job/32397464599?pr=23540#step:13:1110 while running TopicsConsumerImplTest

### What did you expect to see?

No deadlocks

### What did you see instead?

The test didn't shutdown cleanly due to a deadlock.

image

image

image

image

### Anything else?

This might also cause production issues although this happened in a test.

Thread dump: https://gist.github.com/lhotari/ce85ed30ed1c137b69aba7e03b63bfb6
Thread dump in analysis tool: https://jstack.review/?https://gist.github.com/lhotari/ce85ed30ed1c137b69aba7e03b63bfb6#tda_1_thread_generated-id-5

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in TopicsConsumerImplTest on the master branch and review the linked thread dump for the lock cycle involving SystemTopicBasedTopicPoliciesService. Trace the shutdown path identified by the dump and verify that the test exits cleanly without a deadlock.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.