lib/amqp/session.rb in amqp-1.5.1 vs lib/amqp/session.rb in amqp-1.5.2
- old
+ new
@@ -633,11 +633,11 @@
# * Initial TCP connection fails
# @private
def unbind(exception = nil)
if !@tcp_connection_established && !@had_successfully_connected_before && !@intentionally_closing_connection
@tcp_connection_failed = true
- logger.error "[amqp] Detected TCP connection failure"
+ logger.error "[amqp] Detected TCP connection failure: #{exception}"
self.tcp_connection_failed
end
closing!
@tcp_connection_established = false
@@ -928,12 +928,15 @@
def receive_frame(frame)
@frames[frame.channel] ||= Array.new
@frames[frame.channel] << frame
if frameset_complete?(@frames[frame.channel])
- receive_frameset(@frames[frame.channel])
- # for channel.close, frame.channel will be nil. MK.
- clear_frames_on(frame.channel) if @frames[frame.channel]
+ begin
+ receive_frameset(@frames[frame.channel])
+ ensure # Ensure that frames always will be cleared
+ # for channel.close, frame.channel will be nil. MK.
+ clear_frames_on(frame.channel) if @frames[frame.channel]
+ end
end
end
# Processes a frameset by finding and invoking a suitable handler.
# Heartbeat frames are treated in a special way: they simply update @last_server_heartbeat