New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep throwing AlreadyClosedConnection #107

Closed
chainkite opened this Issue Feb 5, 2017 · 3 comments

Comments

4 participants
@chainkite

chainkite commented Feb 5, 2017

In v1.11.0, log4j2 GelfTcpSender

After a period without log, the tcp connection broke without reconnecting. All log after that will get the error below.
The tcp connection will reconnect in v1.10.0, but keep throwing error in v1.11.0

2017-02-04 23:56:10,996 Log4j2-AsyncLoggerConfig-2 ERROR Could not send GELF message: null

This error is thrown from GelfTCPSender, caused by sun.nio.ch.SocketChannelImpl.ensureOpenAndUnconnected() (AlreadyClosedConnection)

These two methods checking channel connectivity are inequal.

Make sure that:

  • You have read the contribution guidelines.
  • You specify the logstash-gelf version and environment so it's obvious which version is affected
  • You provide a reproducible test case (either descriptive of as JUnit test) if it's a bug or the expected behavior differs from the actual behavior.

@chainkite chainkite changed the title from AlreadyClosedConnection to Keep throwing AlreadyClosedConnection Feb 5, 2017

@mp911de mp911de added the type: bug label Feb 5, 2017

@Linuem

This comment has been minimized.

Linuem commented Feb 21, 2017

Same here, can you estimate when this will be fixed?

mp911de added a commit that referenced this issue Feb 26, 2017

Close channel in GelfTCPSender.connect() #107
Always close a channel, if present when attempting connection. Closing the channel is required if the connection failed due to a broken pipe or any other intermediate error which leaves the client channel not closed. Previously, a wrong check to Channel.isOpen() was verifying the wrong state and caused IllegalStateException that are not catched.
@mp911de

This comment has been minimized.

Owner

mp911de commented Feb 27, 2017

I pushed a fix for that issue to master. Care to give the fix a try?

@andr-c

This comment has been minimized.

andr-c commented Feb 28, 2017

Yes, now it seems to be recovering correctly. Thanks!!

@mp911de mp911de added this to the logstash-gelf 1.11.1 milestone Feb 28, 2017

@mp911de mp911de closed this Feb 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment