Commit a74d389
Protect producersByQueueName with sync.RWMutex for concurrent access
The producersByQueueName map is mutated by addProducer (under startStopMu)
but read without any lock by notifyProducerWithoutListenerJobFetch and
notifyProducerWithoutListenerQueueControlEvent, which are called from
Insert paths on arbitrary goroutines. This is a data race.
Add a dedicated RWMutex: write-locked in addProducer, read-locked in the
two notify functions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 6b98fb9 commit a74d389
1 file changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
636 | 636 | | |
637 | 637 | | |
638 | 638 | | |
| 639 | + | |
639 | 640 | | |
640 | 641 | | |
641 | 642 | | |
| |||
1959 | 1960 | | |
1960 | 1961 | | |
1961 | 1962 | | |
1962 | | - | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1963 | 1971 | | |
1964 | 1972 | | |
1965 | 1973 | | |
| |||
2169 | 2177 | | |
2170 | 2178 | | |
2171 | 2179 | | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
2172 | 2183 | | |
2173 | 2184 | | |
2174 | 2185 | | |
| |||
2722 | 2733 | | |
2723 | 2734 | | |
2724 | 2735 | | |
2725 | | - | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
2726 | 2744 | | |
2727 | 2745 | | |
2728 | 2746 | | |
| |||
0 commit comments