Bug 1463111

Summary: broker sends connection heartbeats even on busy connections
Product: Red Hat Enterprise MRG Reporter: Pavel Moravec <pmoravec>
Component: qpid-cppAssignee: messaging-bugs <messaging-bugs>
Status: NEW --- QA Contact: Messaging QE <messaging-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2CC: jross
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pavel Moravec 2017-06-20 07:24:28 UTC
Description of problem:
Summary says it all :) Having a busy connection (with heartbeats enabled), where both peers send a lot of traffic regularly, the broker sends the heartbeats every X seconds (where X is the configured heartbeat interval).

That is redundant and a bit against specification, stating: "The heartbeat control may be used to generate artificial network traffic when a connection is idle. If a connection is idle for more than twice the negotiated heartbeat delay, the peers MAY be considered disconnected."

See the "when a connection is idle".


Version-Release number of selected component (if applicable):
qpid-cpp-server 0.34-21


How reproducible:
100%


Steps to Reproduce:
1. Start qpidd and run tcpdump
2. Run a sender and a consumer:

qpid-send --connection-options "{'heartbeat':2, 'tcp-nodelay':false, 'reconnect':true, 'reconnect-timeout':2, 'reconnect-interval-min':2, 'reconnect-interval-max':2 }" -m 10000000 --capacity=1024 -a "qqq; {create:always}" &

qpid-receive --connection-options "{'heartbeat':2, 'tcp-nodelay':false, 'reconnect':true, 'reconnect-timeout':2, 'reconnect-interval-min':2, 'reconnect-interval-max':2 }" -m 10000000 --capacity=1024 -a "qqq; {create:always}" --print-content=no &

3. Wait 10 seconds or so and stop tcpdump
4. Check in the tcpdump there are frequent (every 2 seconds on either connection) connection.heartbeat AMQP frames (e.g. use filter "amqp.connection.method == 10"))


Actual results:
There are regular heartbeats triggered by the broker on either connection - despite both connections have busy peers on either end.


Expected results:
No heartbeats sent.


Additional info:

Comment 1 Pavel Moravec 2017-06-20 08:05:53 UTC
FYI current upstream is affected the same way

Comment 2 Pavel Moravec 2017-06-20 10:39:07 UTC
.. and any older release since 0.10 exhibit this behaviour as well. The heartbeat is always sent regardless of any traffic sent or received on the AMQP connection recently.