github-vet / github-vet/rangeloop-pointer-findings
project-receptor/receptor: tests/functional/lib/mesh/containermesh.go; 13 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [project-receptor/receptor](https://www.github.com/project-receptor/receptor) at [tests/functional/lib/mesh/containermesh.go](https://github.com/project-receptor/receptor/blob/6c2afd8e2d81b2da6241e40b27813c37b68e4783/tests/functional/lib/mesh/containermesh.go#L508-L520)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.
> range-loop variable node used in defer or goroutine at line 510
[Click here to see the code in its original context.](https://github.com/project-receptor/receptor/blob/6c2afd8e2d81b2da6241e40b27813c37b68e4783/tests/functional/lib/mesh/containermesh.go#L508-L520)
Click here to show the 13 line(s) of Go which triggered the analyzer.
```go
for _, node := range mesh.nodes {
go func() {
node.WaitForShutdown()
failedMesh <- true
}()
select {
case <-failedMesh:
mesh.Destroy()
mesh.WaitForShutdown()
return nil, errors.New("Failed to create mesh")
case <-time.After(time.Until(time.Now().Add(100 * time.Millisecond))):
}
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 6c2afd8e2d81b2da6241e40b27813c37b68e4783
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in tests/functional/lib/mesh/containermesh.go around lines 508-520 and inspect the reported range-loop variable use in the goroutine. Trace the mesh shutdown and failure paths, then verify the relevant functional behavior. Done means the analyzer finding has a justified classification and the affected behavior is confirmed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100