I thought I would bring to the attention of the gem maintainers an issue in ActiveMQ 5.8.0 regarding a bug in its STOMP write heart beat management.
The maintainers should be aware of this bug as it will materially affect testing of the Gem.
A Jira issue was opened against ActiveMQ 5.8.0 #AMQ-4710 for which I have submitted a test and a patch. It has yet to be accepted.
The incorrect behavior ActiveMQ exhibits is that its write checker can sleep for twice (worst case) the configured sleep interval between write heart beats. This can/will confuse connected clients, potentially resulting in a false failover attempt.
Whenever the write checker wakes it checks to see if any data was sent whilst it was asleep. If so, it does nothing and goes back to sleep. This is wrong.
Example (assume the following has happened):
a write checker is running, configured with an interval of 5000ms
a data frame was sent by the broker during the write checker's last sleep interval
the sending of the data frame took place 4000ms before the write checker woke
the write checker wakes, realizes data was sent, does nothing and goes back to sleep
no data is sent by the broker during the next write checker sleep interval
Current behavior:
when the write checker wakes again it will correctly send a KEEPALIVE to the client. However, a total of 9000ms has elapsed since the client last received any data from the broker causing the client to believe the broker has gone away possibly resulting in a false failover attempt by the client.
Correct behavior:
Every time the broker sends the client a data frame the current write checker timer task should be cancelled and replaced with a new one. The new timer task starts counting down immediately. Essentially the timer is 'reset.'
I thought I would bring to the attention of the gem maintainers an issue in ActiveMQ 5.8.0 regarding a bug in its STOMP write heart beat management.
The maintainers should be aware of this bug as it will materially affect testing of the Gem.
A Jira issue was opened against ActiveMQ 5.8.0 #AMQ-4710 for which I have submitted a test and a patch. It has yet to be accepted.
The incorrect behavior ActiveMQ exhibits is that its write checker can sleep for twice (worst case) the configured sleep interval between write heart beats. This can/will confuse connected clients, potentially resulting in a false failover attempt.
Whenever the write checker wakes it checks to see if any data was sent whilst it was asleep. If so, it does nothing and goes back to sleep. This is wrong.
Example (assume the following has happened):
Current behavior:
Correct behavior: