scylladb / scylladb/scylla-cdc-java
Potential race condition while closing Worker
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 32
- Forks
- 23
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
As observed in a CI run (but very hard to reproduce, this run somehow reused a CI container from a previous run which might have polluted the environment): https://github.com/scylladb/scylla-cdc-java/runs/3477278901
The issue seems to arise when two threads concurrently run Worker::stop() and Worker::makeCallable() "continuation":
- Thread B on line 118 checks
shouldStop()and proceeds to go toelse ifbody. - Thread A runs line 154 and 155, setting
shouldStop=trueand shutting down the executor service. - Thread B on line 119 tries to submit a task to executor service, which ends with
java.util.concurrent.RejectedExecutionExceptionas the executor service is now terminated.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in scylla-cdc-base/src/main/java/com/scylladb/cdc/model/worker/Worker.java at the referenced lines in stop() and makeCallable(). Trace the concurrent executor shutdown and task submission paths, then verify that concurrent calls do not produce RejectedExecutionException while closing the Worker.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100