Skip to content

Commit 8724b82

Browse files
committed
Add comment to explain decision tree
References #525 (cherry picked from commit ad69686)
1 parent 1e21fa8 commit 8724b82

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/main/java/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ private void releaseChannel() {
381381
Basic.Cancel m = (Basic.Cancel)method;
382382
String consumerTag = m.getConsumerTag();
383383
Consumer callback = _consumers.remove(consumerTag);
384+
// Not finding any matching consumer isn't necessarily an indication of an issue anywhere.
385+
// Sometimes there's a natural race condition between consumer management on the server and client ends.
386+
// E.g. Channel#basicCancel called just before a basic.cancel for the same consumer tag is received.
387+
// See https://github.com/rabbitmq/rabbitmq-java-client/issues/525
384388
if (callback == null) {
385389
callback = defaultConsumer;
386390
}

0 commit comments

Comments
 (0)