Skip to content

Commit e49f66d

Browse files
committed
Add comment to explain decision tree
References #525 (cherry picked from commit ad69686)
1 parent 365dd22 commit e49f66d

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
@@ -386,6 +386,10 @@ private void releaseChannel() {
386386
Basic.Cancel m = (Basic.Cancel)method;
387387
String consumerTag = m.getConsumerTag();
388388
Consumer callback = _consumers.remove(consumerTag);
389+
// Not finding any matching consumer isn't necessarily an indication of an issue anywhere.
390+
// Sometimes there's a natural race condition between consumer management on the server and client ends.
391+
// E.g. Channel#basicCancel called just before a basic.cancel for the same consumer tag is received.
392+
// See https://github.com/rabbitmq/rabbitmq-java-client/issues/525
389393
if (callback == null) {
390394
callback = defaultConsumer;
391395
}

0 commit comments

Comments
 (0)