Goroutine leak?
sethgrid opened this issue · comments
Hi!
If a function times out, ala:
https://github.com/afex/hystrix-go/blob/master/hystrix/hystrix.go#L160-L165
Then this would block, causing a leaked goroutine:
https://github.com/afex/hystrix-go/blob/master/hystrix/hystrix.go#L97
Yeah?
thanks for the report. i'll get this addressed and add a test
Hi @sethgrid,
If I'm reading you right, I believe https://github.com/afex/hystrix-go/blob/master/hystrix/hystrix.go#L97 shouldn't block because cmd.finished
is a buffered chan.
Ah, a buffered chan should handle that, as long as the buffer does not fill. :)
My observation is that cmd.finished
doesn't fill. Because cmd
is a local variable and is accessed by two goroutines created in the same scope. Only one of them at L97 writes once to cmd.finished
.
I hope I don't miss anything though.
Yes. I should have done that; my bad!