Take ownership of request message 49/113449/7
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 6 Sep 2024 08:39:24 +0000 (10:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 10 Sep 2024 06:48:18 +0000 (08:48 +0200)
We have asynchronous processing here, hence
SimpleChannelInboundHandler's defaults are working against us.

Switch off autoRelease, hence we do not need to issue retain().

JIRA: NETCONF-1379
Change-Id: If4d86111c97122638f17bed52805468d2c3de240
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
protocol/restconf-server/src/main/java/org/opendaylight/restconf/server/RestconfSession.java

index e55fad60d02984c4ed1609d632b625101e069865..d7f56492fb7993ef6513e35d46d1580911a881c3 100644 (file)
@@ -35,12 +35,13 @@ final class RestconfSession extends SimpleChannelInboundHandler<FullHttpRequest>
     private final RestconfRequestDispatcher dispatcher;
 
     RestconfSession(final RestconfRequestDispatcher dispatcher) {
+        super(FullHttpRequest.class, false);
         this.dispatcher = requireNonNull(dispatcher);
     }
 
     @Override
     protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpRequest msg) {
-        dispatcher.dispatch(msg.retain(), new FutureCallback<>() {
+        dispatcher.dispatch(msg, new FutureCallback<>() {
             @Override
             public void onSuccess(final FullHttpResponse response) {
                 final var streamId = msg.headers().getInt(STREAM_ID);