New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
streaming test #44
streaming test #44
Conversation
Thanks for looking into it! Btw, you are not calling flush in the end (that I call done, probably incorrectly:) – is it not needed? The scenario I described here was server streaming the response to the client, not client streaming the request - sorry for the confusion. While we are at it, you can try increasing the chunk size to 32kb - it will fail. It is probably what's agreed between client and server (or it's the default 16kb data frame limit), but the spec says it can be increased during the agreement phase - I assume it's not supported yet? Also, I might be wrong, but it seems that currently it doesn't send frames until it's confirmed by the receiving side (both up and down, although up – to the server – is about 2x faster with local server) – it results in a bad up/download performance. If I am correct, then probably instead of waiting for the response clients and servers have to maintain a set of sent chunks, and send up to some configured max number of them without waiting for the confirmation, and then track unconfirmed chunks). |
Trying to make a failing test case... Passing so far :) |
Hm, this is really weird... I cannot reproduce it in HTTP2 test, but in my test I am observing one of three outcomes, randomly:
Can it be content-related? Or maybe somehow concurrency related? Maybe a stupid question - are you certain that only one thread can read from/write to any given open socket? And now that I removed all debug output it consistently hangs. |
can it be related to the fact that it's connected via TLS? |
Adding a small delay between reads makes it consistently pass without padding (threadDelay 100)... This is the function |
I know it's too much to ask, but maybe you could see what happens in my code and you'll have some idea what could be wrong. I thought that the issue might have been that we had backend that could throw exception on shorter strings passed to HTTP2 Config, so I removed it, but it had no effect. All the interesting lines are in https://github.com/simplex-chat/simplexmq/pull/663/files though:
Overall, this is some concurrency issue either in http2 or in our code, but as I wrote, the same backend is used in plain TLS server and it seems to behave ok there. Will be looking over http2 code too, my hypothesis is that the concurrency issue is there :) |
This API comes from WAI. It's not |
669666b
to
dfcc0e8
Compare
dfcc0e8
to
a27cf72
Compare
Now the test fails based on #45. |
@epoberezkin Please open a new issue if there are still bugs on |
I will try to observe the issue of small chunks vs |
thank you! |
@kazu-yamamoto simplex-chat/simplexmq#667 - both workarounds are removed now with this fix, it all seems to work locally! Will report on how it works in the field once we deploy to real servers, we've just released XFTP that uses your library yesterday: https://simplex.chat/blog/20230301-simplex-file-transfer-protocol.html Thank you! |
@epoberezkin I added the test case which you described in #41.
Fortunately or unfortunately, the test passes.
Would you modify this test so that it fails?