micronaut-core icon indicating copy to clipboard operation
micronaut-core copied to clipboard

Netty DefaultHttpClient logs "BUG - Handler not removed" after adding logbook

Open balapal opened this issue 1 year ago • 1 comments

Expected Behavior

I have added the logbook client handler to the netty pipeline as per documented at https://docs.micronaut.io/latest/guide/#nettyClientPipeline

It properly logs the request/response, but started to see this WARN level log messages: [client-nioEventLoopGroup-4-1] WARN i.m.h.client.netty.DefaultHttpClient - BUG - Handler not removed: ChannelHandlerContext[logbook, [id: 0x34d2..., L:/ipAddress:port - R:domain/ipAddress:port])

I have tried to find the in the micronaut code base where that log message could come from, but didn't find it.

Actual Behaviour

No response

Steps To Reproduce

  1. Create an HTTP client annotated with micronaut's @Client
  2. Add the LogbookNettyClientCustomizer as per the documentation: https://docs.micronaut.io/latest/guide/#nettyClientPipeline
  3. Call the method of the HTTP Client

Environment Information

JDK 17

Example Application

https://docs.micronaut.io/latest/guide/#nettyClientPipeline

Version

4.3.6

balapal avatar Feb 19 '24 15:02 balapal

annoying. it needs to stay in onRequestPipelineBuilt for http2 but has to go into onStreamPipelineBuilt for http1. and it may break entirely in a future update where i replace pipeliningserverhandler for http2. the perils of messing with the handler pipeline directly

yawkat avatar Feb 20 '24 10:02 yawkat