On 20/07/11 22:30, Michael Klishin wrote:
> I am investigating a rare (but nonetheless top priority) amqp gem issue
> when frames are delivered out of order. Neither the Tracer tool nor
> Wireshark give me
> good understanding of what frame exactly RabbitMQ chokes on, it just
> says "expected a method frame, got a non-method frame instead".
That means the server got a content header or body frame, which in case
of client->server communication can only be as part of a publish. The
most likely cause is the client sending more content body frames than it
should, e.g. a trailing empty frame.
It should be possible to spot that from the tracer / wireshark.
> Is it a good idea to make Rabbit log such issues with more detail (it
> shouldn't affect hot code path performance anyway)?
We wouldn't want to log complete frame contents since that would
introduce a major DoS attack vector. Having said that, the error that is
logged (and indeed returned to the client) should include some more info
than it currently does. I have filed a bug for that.
Regards,
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
That means the server got a content header or body frame, which in case of client->server communication can only be as part of a publish. The most likely cause is the client sending more content body frames than it should, e.g. a trailing empty frame.
It should be possible to spot that from the tracer / wireshark.
We wouldn't want to log complete frame contents since that would introduce a major DoS attack vector. Having said that, the error that is logged (and indeed returned to the client) should include some more info than it currently does. I have filed a bug for that.
Is it a good idea to make Rabbit log such issues with more detail (it
shouldn't affect hot code path performance anyway)?
On 20/07/11 23:09, Michael Klishin wrote:
> 2011/7/21 Matthias Radestock <matt...@rabbitmq.com
> <mailto:matt...@rabbitmq.com>>
>
> That means the server got a content header or body frame, which in
> case of client->server communication can only be as part of a
> publish. The most likely cause is the client sending more content
> body frames than it should, e.g. a trailing empty frame.
>
> It should be possible to spot that from the tracer / wireshark.
>
>
> Yes, it is purely a publishing issue and the idea of extra frames has
> crossed my mind. Wireshark doesn't prove it though.
Wireshark should have all the information you need. It probably won't
call this issue out as an error though. Ditto for the tracer.
> I still need to find a way to patch my local rabbit copy to get more
> information. What's a good way to keep a few recent frames around?
Given that you can reproduce the problem easily, you may just want to
log some details of all the frames - frame type, class id, method id,
and for content headers the expected body size, and for content bodies
the payload size.
> Is it possible to implement as a plugin?
No. Well, technically yes, but you are much better off just modifying
the code in rabbit_command_assembler.
Given that you can reproduce the problem easily, you may just want to log some details of all the frames - frame type, class id, method id, and for content headers the expected body size, and for content bodies the payload size.
Given that you can reproduce the problem easily, you may just want to log some details of all the frames - frame type, class id, method id, and for content headers the expected body size, and for content bodies the payload size.
On 21/07/11 03:51, Michael Klishin wrote:
> So far I narrowed it down to the "empty messages" problem: whenever
> there is an empty message sent by amqp gem master version, RabbitMQ
> doesn't consider it a complete message and thus clients do not get
> anything. With a simple script that terminates as soon as the message is
> received
> (by the same process), this looks like app is hanging. In the context of
> a larger application, sometimes there are empty messages transmitted (I
> am streaming a stdout output).
>
> After comparing 2 clients I see the following picture: the data
> transmitted is exactly the same, frame order is correct but Wireshark
> GUI suggests that
> one client transmits 3 frames as 3 IP packets. In this case, RabbitMQ is
> happy. The other transmits them all in a single IP packet and RabbitMQ
> doesn't seem to recognize it as a complete message.
>
> Here are two Wireshark session exports:
> https://gist.github.com/1096404
>
> If the [frames] content is the same, what may be going on here?
That's curious. Both should cause rabbit to complain with the "expected
method frame, got non method frame instead" error. Are you sure you are
seeing different behaviour here? If so, please send through the pcap
files showing the entire tcp session.
Content body frames should never be zero length. If the content length
is zero then no content body frame should be sent at all, just a header.
That's curious. Both should cause rabbit to complain with the "expected method frame, got non method frame instead" error. Are you sure you are seeing different behaviour here? If so, please send through the pcap files showing the entire tcp session.
Content body frames should never be zero length. If the content length is zero then no content body frame should be sent at all, just a header.
Correct.
On 21/07/11 11:15, Michael Klishin wrote:Correct.
So for a blank string payload, the sequence is always
[method frame] [content header frame]
not
[method frame] [content header frame] [content body frame with size = 0]
correct?
Ah, yes, I read this line in the spec but then the fact that another Ruby client that *also sends an empty content body frame* works fine confused me.
I could have sworn I made a pull-request with this commit https://github.com/tonyg/amqp/commit/d92a455dcc6763a4495f512f0d74f667354e5a60 some time ago, but I can't for the life of me find it now. Just FTR. It might be worth comparing with the solution you've adopted.