[GODRIVER-2533] Data race when fetching the number of sessions in progress Created: 24/Aug/22 Updated: 28/Oct/23 Resolved: 04/Oct/22 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.10.3 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Ivaylo Novakov | Assignee: | Benji Rewis (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Description |
SummaryCalling db.Client().NumberSessionsInProgress() from one goroutine triggers the data race detector when other goroutines are working with the database calling CountDocuments() or other operation. Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).Driver version v1.10.1. Topology: replica set with a single server. How to ReproduceSteps to reproduce. If possible, please include a Short, Self Contained, Correct (Compilable), Example.
Additional BackgroundPlease provide any additional background information that may be helpful in diagnosing the bug. |
| Comments |
| Comment by Ivaylo Novakov [ 04/Oct/22 ] |
|
Happy to help! Thanks for the fix! |
| Comment by Benji Rewis (Inactive) [ 04/Oct/22 ] |
|
Thanks again for your bug report inovakov@gmail.com. We've changed checkedOut to be an atomically-accessed int64, and the fix will be backported to the upcoming 1.10.3 version of the Go driver. |
| Comment by Githook User [ 04/Oct/22 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Githook User [ 04/Oct/22 ] |
|
Author: {'name': 'Benjamin Rewis', 'email': '32186188+benjirewis@users.noreply.github.com', 'username': 'benjirewis'}Message: |
| Comment by Benji Rewis (Inactive) [ 04/Oct/22 ] |
| Comment by Benji Rewis (Inactive) [ 26/Sep/22 ] |
|
inovakov@gmail.com thanks so much for your report and apologies for the delay! We're investigating this data race now. |
| Comment by Ivaylo Novakov [ 24/Aug/22 ] |
|
The rich text formatting garbled the code a bit, so here is an unformatted copy.
func TestDataRace(t *testing.T) { go func() { }() |