afex / hystrix-go

Netflix's Hystrix latency and fault tolerance library, for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goroutine leak?

sethgrid opened this issue · comments

commented

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.

@sethgrid @afex should this issue be closed?

Yes. I should have done that; my bad!