solver: protect field access with lock to avoid potential data race
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 10.3k
- Forks
- 1.5k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 50
Description
Description
It seems to be a potential data race. Specifically, there are two confilicting operations on the field "edges", where the read operation at: solver/jobs.go:187, and the write operation at: solver/jobs.go:151. A data race may occurs when the two functions where the two operations are located. This is same with the field "op" in the file.
Reproduce
nil
Expected behavior
data race
docker version
nil
docker info
nil
Additional Info
No response
Contributor guide
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
Read solver/jobs.go around lines 151 and 187, then trace the two functions that write and read the edges and op fields. Confirm the concurrent accesses and determine the appropriate synchronization, then use a race-enabled run to verify that the reported data race no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100