ruby-amqp/bunny — pull request #247 by 0xfaded (2014-09-17 00:37:44+00:00)
Title: Fix extra channel being created on recovery.

Fixes #245

@default_channel is created by Session.start, which is also called
by Session.recover_from_network_failure. Because no identifier is
passed to Channel.new, on recovery a new @default_channel is created
with the next available identifier.

Session.recover_channels previously contained a check to prevent
@default_channel from being reopened twice by comparing each channel
in @channels to @default_channel. However since Session.start is
called before channel_recovery, and @channels still contains the
old @default_channel, the old @default_channel is also reopened,
resulting in an extra channel.