github-vet / github-vet/rangeloop-pointer-findings
chainlighting/xPipeline: core/producer.go; 17 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [chainlighting/xPipeline](https://www.github.com/chainlighting/xPipeline) at [core/producer.go](https://github.com/chainlighting/xPipeline/blob/de21246abec646091e34795b7a0d1539e40d5013/core/producer.go#L458-L474)
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 msg used in defer or goroutine at line 464
[Click here to see the code in its original context.](https://github.com/chainlighting/xPipeline/blob/de21246abec646091e34795b7a0d1539e40d5013/core/producer.go#L458-L474)
Click here to show the 17 line(s) of Go which triggered the analyzer.
```go
for msg := range prod.messages {
// handleMessage may block. To be able to exit this method we need to
// call it async and wait for it to finish.
flushWorker.Inc()
go func() {
defer flushWorker.Done()
handleMessage(msg)
}()
if !flushWorker.WaitFor(prod.shutdownTimeout) {
Log.Warning.Printf("A producer listening to %s has found to be blocking during close. Dropping remaining messages.", StreamRegistry.GetStreamName(prod.Streams()[0]))
for msg := range prod.messages {
prod.Drop(msg)
}
return false // ### return, timed out ###
}
}
```
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: de21246abec646091e34795b7a0d1539e40d5013
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.