[noPoll] Stress Test -- Final Flag after calling nopoll_conn_get_msg

Kale, Rahul Rahul.Kale en barco.com
Jue Jun 2 03:16:06 CEST 2016



Hello,

For the following discussion reference noPoll test code at:

https://github.com/rpkale/test-nopoll


One issue I had trouble with is the significance of the 'final' flag when a
message is received. The client tries to collect message of a known fixed
size that it expects to arrive from the server. Initially I tried to use the
'final' flag (nopoll_msg_is_final(msg)) to detect that the last part of  full
message has arrived. However this flag was not always set reliably. Sometimes
the flag would be set even before a complete message has been collected.

What I observed is that if a message gets fragmented, the total length of all
the message fragments always adds up perfectly to the expected message length.
The final flag is also always set on the last fragment. But the final flag is
also sometimes unexpectedly set on intermediate fragments.

Due to this I could not implement the client side getResponse() function
using just the 'final' flag. Eventually I ended up implementing the detection
of a complete message based on length seen so far and knowing the expected
length.

I feel that something is not quite right here. You mention that real
implementations should always treat the data as a byte stream and not depend
on fragmentation. But in this test case, there is no other intermediary doing
additional fragmentation (only noPoll library involved). And the logic is
only trying to catch the is_final() condition and not the is_fragment()
condition. Should not this flag be set reliably on the server and retrieved
reliably on the client on the last fragment? Otherwise what is the purpose of
this flag in the websocket specification?

You can reproduce the issue by enabling debug log (export
NOPOLL_TEST_DEBUG=1) and running one client instance against a server. Look
for "Final flag set arbitrarily??" in the output.
There is another condition that I try to catch and output "Final flag not set??".
This does not happen with the latest noPoll build but I used to see this with the
earlier builds.
Would really appreciate if you could shed some light on this.
Is my assumption wrong? Or is there an implementation problem
in the test code?

Regards,

Rahul



Rahul Kale

IP Video Systems
Barco, Inc
1287 Anvilwood Ave
Sunnyvale, CA  94089

Tel  +1 408 400 4238

This message is subject to the following terms and conditions: MAIL DISCLAIMER<http://www.barco.com/en/maildisclaimer>
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://lists.aspl.es/pipermail/nopoll/attachments/20160602/5c4e0fb4/attachment.html>


Más información sobre la lista de distribución noPoll