If you call channels.release(), that removes the channel from the channel map and detaches it. However, the protocol messaged for DETACHED returning to us re-adds the channel to the channel map (via a call to channels.get()), therefore undoing the release action.
One way to fix this would be to not re-add the channel when processing DETACHED if its not there.
If you call channels.release(), that removes the channel from the channel map and detaches it. However, the protocol messaged for DETACHED returning to us re-adds the channel to the channel map (via a call to channels.get()), therefore undoing the release action.
One way to fix this would be to not re-add the channel when processing DETACHED if its not there.