Repository: camel Updated Branches: refs/heads/camel-2.15.x 3a9145f6e -> 14ec99f52 refs/heads/camel-2.16.x ecc996602 -> 64faddc44
CAMEL-9639: camel-netty - Should invalidate object if cannot return to pool. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/64faddc4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/64faddc4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/64faddc4 Branch: refs/heads/camel-2.16.x Commit: 64faddc4418741fb1c9d14d268c3c17afd567365 Parents: ecc9966 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Feb 24 11:27:08 2016 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Feb 24 11:27:08 2016 +0100 ---------------------------------------------------------------------- .../java/org/apache/camel/component/netty4/NettyProducer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/64faddc4/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java index d0d8eb7..8655be7 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyProducer.java @@ -466,9 +466,13 @@ public class NettyProducer extends DefaultAsyncProducer { if (channel.isActive()) { LOG.trace("Putting channel back to pool {}", channel); pool.returnObject(channel); + } else { + // and if its not active then invalidate it + LOG.trace("Invalidating channel from pool {}", channel); + pool.invalidateObject(channel); } } catch (Exception e) { - LOG.warn("Error returning channel to pool {}. This exception will be ignored.", channel); + LOG.warn("Error returning channel to pool " + channel + ". This exception will be ignored.", e); } finally { // ensure we call the delegated callback callback.done(doneSync);