You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by mbroadst <mb...@gmail.com> on 2015/10/21 20:15:45 UTC

ActiveMQ does not seem to honor the agreed upon idle-time-out

Hi,
I'm a maintainer for a node.js amqp 1.0 module (node-amqp10), and we have a
user currently facing issues connecting to an ActiveMQ instance. It seems
that when our client sends our default idle timeout of 120000ms in the
initial open performative, ActiveMQ is not honoring that value. ActiveMQ
does seem to "agree" to the terms, and sends back 120000ms back in the
corresponding handshake Open performative, but then appears to expect
heartbeat (or flow) messages every 30s (which I gather is the default). Is
this is a bug, or are we missing something during the handshake? 

Thanks,
Matt



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: ActiveMQ does not seem to honor the agreed upon idle-time-out

Posted by Timothy Bish <ta...@gmail.com>.
On 10/22/2015 12:21 PM, mbroadst wrote:
> Hi Tim,
> Okay, I'm going by section 2.4.5 of the spec here where it indicates: "At
> connection open each peer communicates the maximum period between activity
> (frames) on the connection that it desires from its partner." Then in
> section 2.4.1 we have: " After establishing or accepting a TCP connection
> and sending the protocol header, each peer MUST send an open frame before
> sending any other frames. The open frame describes the capabilities and
> limits of that peer". This is where my concept of a handshake (or
> "agreement", if you will) came from.
>
> I can confirm that our client sends out an Open performative with our
> desired timeout in it (120s), and ActiveMQ responds with a corresponding
> Open performative with exactly the same value I send (so 120s in this case).
> >From my perspective this would appear that ActiveMQ has "agreed" to the
> terms of the idle timeout and should therefore use that value for its
> internal bookkeeping. Nowhere in this initial connection setup does the
> value 30s appear (or rater 30000 for ms), ActiveMQ just seems to send back
> the same idle-time-out value I send.
>
> I have fairly verbose frame traces if that would be of assistance on your
> side?
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244p4703290.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
Our unit tests would tend to disagree with the assertion that the broker
takes the peer value and returns it, perhaps you have configured the
broker's AMQP transportConnector with a non-default idleTimeout value.

You are welcome to open a jira and attach a frame trace of the handshake
and your broker configuration if you think there is a problem.

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.redhat.com 
twitter: @tabish121
blog: http://timbish.blogspot.com/


Re: ActiveMQ does not seem to honor the agreed upon idle-time-out

Posted by mbroadst <mb...@gmail.com>.
Tim, Robbie,
Thanks for your quick responses. I was wracking my brain, since our unit and
integration tests also guaranteed that these values were used as they came
in off the wire. It turns out that a misspelled variable in our trace log
was leading me astray, printing out our default idle-time-out instead of the
value actually contained in the Open performative from the broker!

Many apologies for the noise.



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244p4703325.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: ActiveMQ does not seem to honor the agreed upon idle-time-out

Posted by Robbie Gemmell <ro...@gmail.com>.
On 22 October 2015 at 17:21, mbroadst <mb...@gmail.com> wrote:
> Hi Tim,
> Okay, I'm going by section 2.4.5 of the spec here where it indicates: "At
> connection open each peer communicates the maximum period between activity
> (frames) on the connection that it desires from its partner." Then in
> section 2.4.1 we have: " After establishing or accepting a TCP connection
> and sending the protocol header, each peer MUST send an open frame before
> sending any other frames. The open frame describes the capabilities and
> limits of that peer". This is where my concept of a handshake (or
> "agreement", if you will) came from.
>

Tim is correct that the values are independent, since peers dont
necessarily need to wait for the others Open etc frames to arrive
before they send theirs. A 'broker' peer might, but it doesnt have to.

> I can confirm that our client sends out an Open performative with our
> desired timeout in it (120s), and ActiveMQ responds with a corresponding
> Open performative with exactly the same value I send (so 120s in this case).
> From my perspective this would appear that ActiveMQ has "agreed" to the
> terms of the idle timeout and should therefore use that value for its
> internal bookkeeping. Nowhere in this initial connection setup does the
> value 30s appear (or rater 30000 for ms), ActiveMQ just seems to send back
> the same idle-time-out value I send.
>
> I have fairly verbose frame traces if that would be of assistance on your
> side?
>
>

Certainly in recent codebase, the broker only seems to use its own
config to drive its advertised idle-timeout, defaulting to 30sec. It
only seems to look at the remote peers requested value at all while it
is checking that the 'inactivity monitor' used to do the work isn't
disabled (meaning it wouldnt be able to send any heartbeats, so it
then fails the connection attempt).

I might have missed it, but I can't see mention of which ActiveMQ
version you are using. It could be that is important.

>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244p4703290.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: ActiveMQ does not seem to honor the agreed upon idle-time-out

Posted by mbroadst <mb...@gmail.com>.
Hi Tim,
Okay, I'm going by section 2.4.5 of the spec here where it indicates: "At
connection open each peer communicates the maximum period between activity
(frames) on the connection that it desires from its partner." Then in
section 2.4.1 we have: " After establishing or accepting a TCP connection
and sending the protocol header, each peer MUST send an open frame before
sending any other frames. The open frame describes the capabilities and
limits of that peer". This is where my concept of a handshake (or
"agreement", if you will) came from.

I can confirm that our client sends out an Open performative with our
desired timeout in it (120s), and ActiveMQ responds with a corresponding
Open performative with exactly the same value I send (so 120s in this case).
>From my perspective this would appear that ActiveMQ has "agreed" to the
terms of the idle timeout and should therefore use that value for its
internal bookkeeping. Nowhere in this initial connection setup does the
value 30s appear (or rater 30000 for ms), ActiveMQ just seems to send back
the same idle-time-out value I send.

I have fairly verbose frame traces if that would be of assistance on your
side?



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244p4703290.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.

Re: ActiveMQ does not seem to honor the agreed upon idle-time-out

Posted by Timothy Bish <ta...@gmail.com>.
On 10/21/2015 02:15 PM, mbroadst wrote:
> Hi,
> I'm a maintainer for a node.js amqp 1.0 module (node-amqp10), and we have a
> user currently facing issues connecting to an ActiveMQ instance. It seems
> that when our client sends our default idle timeout of 120000ms in the
> initial open performative, ActiveMQ is not honoring that value. ActiveMQ
> does seem to "agree" to the terms, and sends back 120000ms back in the
> corresponding handshake Open performative, but then appears to expect
> heartbeat (or flow) messages every 30s (which I gather is the default). Is
> this is a bug, or are we missing something during the handshake? 
>
> Thanks,
> Matt
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-does-not-seem-to-honor-the-agreed-upon-idle-time-out-tp4703244.html
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>
The broker and client don't "agree" on timeouts, the broker will send
the idle timeout value it wants the client to honor, and the client will
send it's requirements to the broker.  By default the broker Idle
timeout is set to 30s so it will request the client to send a heartbeat
at half that interval.

You should start capturing some frame traces between client and broker
which should give you some more clarity on what is going on. 

-- 
Tim Bish
Sr Software Engineer | RedHat Inc.
tim.bish@redhat.com | www.redhat.com 
twitter: @tabish121
blog: http://timbish.blogspot.com/