Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird data race #1491

Open
1 of 5 tasks
bigsheeper opened this issue Jul 7, 2023 · 1 comment
Open
1 of 5 tasks

Weird data race #1491

bigsheeper opened this issue Jul 7, 2023 · 1 comment

Comments

@bigsheeper
Copy link

bigsheeper commented Jul 7, 2023

Describe the bug
An unusual data race has occurred between a variable and the invocation of common.ReadLines(). Here is the log:

23-07-07T07:47:13.5966180Z WARNING: DATA RACE
2023-07-07T07:47:13.5966475Z Write at 0x000004b38028 by goroutine 200:
2023-07-07T07:47:13.5968577Z   [github.com/milvus-io/milvus/internal/datanode.TestFlowGraphManager.func7()](http://github.com/milvus-io/milvus/internal/datanode.TestFlowGraphManager.func7())
2023-07-07T07:47:13.5970414Z       /go/src/[github.com/milvus-io/milvus/internal/datanode/flow_graph_manager_test.go:209](http://github.com/milvus-io/milvus/internal/datanode/flow_graph_manager_test.go:209) +0x2a9
2023-07-07T07:47:13.5970826Z   testing.tRunner()
2023-07-07T07:47:13.5971152Z       /usr/local/go/src/testing/testing.go:1439 +0x213
2023-07-07T07:47:13.5971474Z   testing.(*T).Run.func1()
2023-07-07T07:47:13.5971809Z       /usr/local/go/src/testing/testing.go:1486 +0x47
2023-07-07T07:47:13.5972015Z 
2023-07-07T07:47:13.5972177Z Previous read at 0x000004b38028 by goroutine 112:
2023-07-07T07:47:13.5972474Z   ??()
2023-07-07T07:47:13.5972808Z       -:0 +0xffffffffffffffff
2023-07-07T07:47:13.5973166Z   [github.com/shirou/gopsutil/v3/internal/common.ReadLines()](http://github.com/shirou/gopsutil/v3/internal/common.ReadLines())
2023-07-07T07:47:13.5973605Z       /go/pkg/mod/[github.com/shirou/gopsutil/v3@v3.22.9/internal/common/common.go:111](http://github.com/shirou/gopsutil/v3@v3.22.9/internal/common/common.go:111) +0x96
2023-07-07T07:47:13.5975075Z   [github.com/shirou/gopsutil/v3/mem.fillFromMeminfoWithContext()](http://github.com/shirou/gopsutil/v3/mem.fillFromMeminfoWithContext())
2023-07-07T07:47:13.5975676Z       /go/pkg/mod/[github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:60](http://github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:60) +0x88
2023-07-07T07:47:13.5976132Z   [github.com/shirou/gopsutil/v3/mem.VirtualMemoryWithContext()](http://github.com/shirou/gopsutil/v3/mem.VirtualMemoryWithContext())
2023-07-07T07:47:13.5977552Z       /go/pkg/mod/[github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:39](http://github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:39) +0x2e
2023-07-07T07:47:13.5977999Z   [github.com/shirou/gopsutil/v3/mem.VirtualMemory()](http://github.com/shirou/gopsutil/v3/mem.VirtualMemory())
2023-07-07T07:47:13.5979086Z       /go/pkg/mod/[github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:35](http://github.com/shirou/gopsutil/v3@v3.22.9/mem/mem_linux.go:35) +0x36
2023-07-07T07:47:13.5979975Z   [github.com/milvus-io/milvus/internal/util/hardware.GetMemoryCount()](http://github.com/milvus-io/milvus/internal/util/hardware.GetMemoryCount())
2023-07-07T07:47:13.5980715Z       /go/src/[github.com/milvus-io/milvus/internal/util/hardware/hardware_info.go:83](http://github.com/milvus-io/milvus/internal/util/hardware/hardware_info.go:83) +0x9b
2023-07-07T07:47:13.5981292Z   [github.com/milvus-io/milvus/internal/datanode.(*flowgraphManager).start()](http://github.com/milvus-io/milvus/internal/datanode.(*flowgraphManager).start())
2023-07-07T07:47:13.5981868Z       /go/src/[github.com/milvus-io/milvus/internal/datanode/flow_graph_manager.go:55](http://github.com/milvus-io/milvus/internal/datanode/flow_graph_manager.go:55) +0xcf
2023-07-07T07:47:13.5983424Z   [github.com/milvus-io/milvus/internal/datanode.(*DataNode).Start.func5()](http://github.com/milvus-io/milvus/internal/datanode.(*DataNode).Start.func5())
2023-07-07T07:47:13.5984192Z       /go/src/[github.com/milvus-io/milvus/internal/datanode/data_node.go:519](http://github.com/milvus-io/milvus/internal/datanode/data_node.go:519) +0x39

The write operation at flow_graph_manager_test.go:209 pertains to a variable that appears to be unrelated to gopsutil:
image
https://github.com/milvus-io/milvus/blob/56c32d3b32cd3ef86ff1e920a57eea2e3a6631d9/internal/datanode/flow_graph_manager_test.go#L209

The definition of this variable:
image
https://github.com/milvus-io/milvus/blob/56c32d3b32cd3ef86ff1e920a57eea2e3a6631d9/internal/util/paramtable/component_param.go#L1731C32-L1731C32

To Reproduce
gopsutil version we are using: github.com/shirou/gopsutil/v3 v3.22.9

Expected behavior
No data race.

Environment (please complete the following information):

  • Windows: [paste the result of ver]
  • Linux: [paste contents of /etc/os-release and the result of uname -a]
  • Mac OS: [paste the result of sw_vers and uname -a
  • FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
  • OpenBSD: [paste the result of uname -a]

Additional context

@shirou
Copy link
Owner

shirou commented Jul 11, 2023

Is there any reproducible short code? And does it reproduce using the latest version(v3.23.6)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants