kazu-yamamoto / http2

HTTP/2.0 library including HPACK
BSD 3-Clause "New" or "Revised" License
86 stars 22 forks source link

Bug (?): trailers may be sent _before_ final data frame #86

Closed edsko closed 1 year ago

edsko commented 1 year ago

I am not 100% sure about this, but I am getting some test failures in my gRPC library, and studying the Wireshark output, I am seeing the trailers frame before the final data frame in failing test cases. The the trailers and the final data frame are in the same packet, then they are reassembled in the correct order on the receiving side, but if there happens to be packet boundary between them, then this does not happen (and my tests fail). I can very significantly decrease the likelyhood of this happening by doing a final flush in the function that is producing the streaming output, but it seems not to 0%.

kazu-yamamoto commented 1 year ago

Nice catch! There would be a corner case on trailers. If you find a way to reproduce this, please let me know. I'd love to debug it. I'm concentrating DNS stuff this week. I will be able to get back HTTP/2 in the next week.

edsko commented 1 year ago

I'm debugging this as we speak, and I am no longer convinced that the problem is in http2, I might have misread Wireshark. I will keep looking at this and report back.

I will be at HIW/ICFP/HS next week, so you might not hear from me until after then :)

edsko commented 1 year ago

Ok, I do think this is a problem in http2, but not related to trailers. I will open a new ticket to avoid confusion.