Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-10244

When same netty endpoint producer is used twice in a route, BlockingOperationException is raised

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.3
    • 2.17.4, 2.18.0
    • camel-netty4
    • None
    • Patch Available
    • Unknown
    • Patch

    Description

      Due to synchronous nature of connection establishment, when same endpoint producer is used twice in same route (e.g. to make two sequential WS calls), BlockingOperationException is thrown:

      java.lang.AssertionError: io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@4360ffb3(incomplete)
      	at org.apache.camel.component.netty4.NettyTCPChainedTest.sendFile(NettyTCPChainedTest.java:53)
      	at org.apache.camel.component.netty4.NettyTCPChainedTest.testTCPChainedConnectionFromCallbackThread(NettyTCPChainedTest.java:62)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
      Caused by: io.netty.util.concurrent.BlockingOperationException: DefaultChannelPromise@4360ffb3(incomplete)
      	at io.netty.util.concurrent.DefaultPromise.checkDeadLock(DefaultPromise.java:398)
      	at io.netty.channel.DefaultChannelPromise.checkDeadLock(DefaultChannelPromise.java:157)
      	at io.netty.util.concurrent.DefaultPromise.awaitUninterruptibly(DefaultPromise.java:254)
      	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:135)
      	at io.netty.channel.DefaultChannelPromise.awaitUninterruptibly(DefaultChannelPromise.java:28)
      	at org.apache.camel.component.netty4.NettyProducer.openChannel(NettyProducer.java:488)
      	at org.apache.camel.component.netty4.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:563)
      	at org.apache.camel.component.netty4.NettyProducer$NettyProducerPoolableObjectFactory.makeObject(NettyProducer.java:558)
      	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1188)
      	at org.apache.camel.component.netty4.NettyProducer.process(NettyProducer.java:210)
      	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
      	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
      	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:542)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:197)
      	at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
      	at org.apache.camel.processor.Pipeline.access$100(Pipeline.java:44)
      	at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:138)
      	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:257)
      	at org.apache.camel.processor.RedeliveryErrorHandler$2.done(RedeliveryErrorHandler.java:554)
      	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:155)
      	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:257)
      	at org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:257)
      	at org.apache.camel.processor.RedeliveryErrorHandler$2.done(RedeliveryErrorHandler.java:554)
      	at org.apache.camel.processor.SendProcessor$1.done(SendProcessor.java:155)
      	at org.apache.camel.component.netty4.NettyProducer$NettyProducerCallback.done(NettyProducer.java:550)
      	at org.apache.camel.component.netty4.NettyProducer$2.operationComplete(NettyProducer.java:338)
      	at org.apache.camel.component.netty4.NettyProducer$2.operationComplete(NettyProducer.java:304)
      	at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
      	at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:488)
      	at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
      	at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:111)
      	at io.netty.channel.DefaultChannelPromise.trySuccess(DefaultChannelPromise.java:82)
      	at io.netty.channel.ChannelOutboundBuffer.safeSuccess(ChannelOutboundBuffer.java:673)
      	at io.netty.channel.ChannelOutboundBuffer.remove(ChannelOutboundBuffer.java:263)
      	at io.netty.channel.ChannelOutboundBuffer.removeBytes(ChannelOutboundBuffer.java:343)
      	at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:425)
      	at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
      	at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:356)
      	at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:786)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:778)
      	at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:759)
      	at io.netty.channel.ChannelOutboundHandlerAdapter.flush(ChannelOutboundHandlerAdapter.java:115)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:786)
      	at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:778)
      	at io.netty.channel.AbstractChannelHandlerContext.access$1500(AbstractChannelHandlerContext.java:38)
      	at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1149)
      	at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1090)
      	at io.netty.util.concurrent.SingleThreadEventExecutor.safeExecute(SingleThreadEventExecutor.java:451)
      	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:418)
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:401)
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:877)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              tivv Vitalii Tymchyshyn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: