Graylog2 / go-gelf

GELF library for Go
http://godoc.org/github.com/Graylog2/go-gelf/gelf
MIT License
103 stars 64 forks source link

Fix crash when the server drops and does not return #19

Closed ghislainbourgeois closed 6 years ago

ghislainbourgeois commented 6 years ago

This adds a new test that closes the server and continue to write to it. It uncovered a bug with an unhandled nil pointer. It also uncovered some issues in the reconnection logic that were fixed at the same time.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

ghislainbourgeois commented 6 years ago

This fixes moby downstream issue 35613

ghislainbourgeois commented 6 years ago

@mariussturm, @0cjs, @iporsut, @MiLk, can you review this bug fix? It fixes a problem that was missed when the server is goes completely offline.

mariussturm commented 6 years ago

On it, but this is not trivial code.

ghislainbourgeois commented 6 years ago

This is the first time I hear about context, my go-fu is quite limited, but from what I read, I am not sure it would be cleaner than the multiple signals. The thing is that we need to be able to control the tcpreader test harness to drop only active connections, or the whole server synchronously with the test itself.

Am I missing something on the Context?

mariussturm commented 6 years ago

Thanks for the PR, LGTM!