Skip to content

UnknownChannelException in AMQConnection.MainLoop.run #189

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

Closed
vikinghawk opened this issue Sep 1, 2016 · 3 comments
Closed

UnknownChannelException in AMQConnection.MainLoop.run #189

vikinghawk opened this issue Sep 1, 2016 · 3 comments
Assignees
Milestone

Comments

@vikinghawk
Copy link
Contributor

Encountered this error in my ExceptionHandler.handleUnexpectedConnectionDriverException method a couple times on version 3.6.3 with connection and topology recovery enabled.

Message: RabbitExceptionHandler: Caught unexpected connection driver exception for connection XXX
Throwable: com.rabbitmq.client.impl.UnknownChannelException: Unknown channel number 147
at com.rabbitmq.client.impl.ChannelManager.getChannel(ChannelManager.java:82)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:560)

Looks to me like there is possibility MainLoop is processing a frame with a channel number that doesn't exist in ChannelManager? Not sure how that is possible and I can't reliably reproduce... Could potentially handle this scenario in a better way though?

@vikinghawk vikinghawk changed the title Possible NPE in AMQConnection.MainLoop.run UnknownChannelException in AMQConnection.MainLoop.run Sep 1, 2016
@acogoluegnes
Copy link
Contributor

Could you provide us with a unit test that reproduces the exception? What do mean by handling this scenario in a better way? Silently ignoring the exception? Not sure it's a good idea.

BTW, also make sure your channels are accessed by only one thread at the same time, as they're not thread-safe.

@michaelklishin
Copy link
Contributor

If a channel was removed from the manager when there was e.g. a delivery in flight. In some cases the best we can do is to ignore it and log a warning, I believe at least Bunny already does that.

@acogoluegnes
Copy link
Contributor

OK for catching the exception and logging it.

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