Skip to content
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

Client attempts to reconnect during shutdown #46

Open
danotorrey opened this issue Oct 21, 2019 · 3 comments
Open

Client attempts to reconnect during shutdown #46

danotorrey opened this issue Oct 21, 2019 · 3 comments

Comments

@danotorrey
Copy link
Contributor

danotorrey commented Oct 21, 2019

When shutting down the GELF Client, it immediately attempts to reconnect, which results in the following error message:

INFO org.graylog2.gelfclient.transport.GelfHttpTransport - Channel disconnected!

The same issue happens for the transport.stop() and transport.flushAndStopSynchronously() methods.

No ill effects occur, but this should be cleaned up. Reconnects should not be attempted after calling either of the stop methods.

@lingpri
Copy link

lingpri commented Oct 22, 2019

I was reading through the class GelfHttpTransport.java, lineno:113 and am wondering , if method exceptionCaught is missing ctx.close() in it.

@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { LOG.error("Exception caught", cause); }

@lingpri
Copy link

lingpri commented Oct 23, 2019

Stack Overflow Ref link:

Development Environment Setup for debugging

JUST an FYI, to enable debugging pass this as a vm argument in INtellij
-Dorg.slf4j.simpleLogger.defaultLogLevel=debug

[gelfHttpTransport-1-1] DEBUG io.netty.channel.DefaultChannelPipeline - Discarded inbound message DefaultHttpResponse(decodeResult: success, version: HTTP/1.1) HTTP/1.1 202 Accepted content-length: 0 connection: close that reached at the tail of the pipeline. Please check your pipeline configuration. [gelfHttpTransport-1-1] DEBUG io.netty.channel.DefaultChannelPipeline - Discarded message pipeline : [HttpClientCodec#0, HttpContentDecompressor#0, GelfHttpEncoder#0, GelfMessageJsonEncoder#0, GelfHttpTransport$1$1#0, DefaultChannelPipeline$TailContext#0]. Channel : [id: 0x43372ef6, L:/127.0.0.1:51548 - R:/127.0.0.1:42323]. [gelfHttpTransport-1-1] DEBUG io.netty.channel.DefaultChannelPipeline - Discarded inbound message EmptyLastHttpContent that reached at the tail of the pipeline. Please check your pipeline configuration. [gelfHttpTransport-1-1] DEBUG io.netty.channel.DefaultChannelPipeline - Discarded message pipeline : [HttpClientCodec#0, HttpContentDecompressor#0, GelfHttpEncoder#0, GelfMessageJsonEncoder#0, GelfHttpTransport$1$1#0, DefaultChannelPipeline$TailContext#0]. Channel : [id: 0x43372ef6, L:/127.0.0.1:51548 - R:/127.0.0.1:42323]. [gelfHttpTransport-1-1] INFO org.graylog2.gelfclient.transport.GelfHttpTransport - Channel disconnected! [GelfSenderThread-14] DEBUG org.graylog2.gelfclient.transport.GelfSenderThread - GelfSenderThread exiting!

@lingpri
Copy link

lingpri commented Oct 24, 2019

@danotorrey In class , GelfHttpEncoder, making the HTTP header connection, to keep alive, request.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.KEEP_ALIVE);
doesn't call the lifecycle method
public void channelInactive(ChannelHandlerContext ctx) throws Exception

I'm thinking this is not a bug. Please advice.

@danotorrey danotorrey self-assigned this Oct 28, 2019
@danotorrey danotorrey removed their assignment Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants