Graylog2/gelf-rb — pull request #9 by jondot (2012-08-27 09:20:46+00:00)
Title: Unexplained error when using on JRuby and log4r-gelf

Stack trace:
https://gist.github.com/3486823

From my examination, it shouldn't have anything to do with log4r-gelf. Something here relates to the initialization of JRuby UDPSocket, but I cannot put my finger on it exactly -- I would be very sad if this is a JRuby bug since I spent quite a long time trying to isolate it.

It looks like a concurrency problem, but it isn't, from my tests (tried ruby threads and Java Executors). It may be a concurrency problem with initialize vs send on the socket but I'm not sure.

Either case lazily initializing magically solved it.

I'll be happy if you also have some further input on why this might happen in the first place?

Thanks.