Hi Lukas, On Wed, Jan 03, 2018 at 05:34:36PM +0100, Lukas Tribus wrote: > Hello Peter, > > > On Wed, Jan 3, 2018 at 2:59 PM, Lukas Tribus <[email protected]> wrote: > > I will come back later and take a deeper look at both strace and the > > capture. > > So, this is broken since c4134ba8b0 ("BUG/MEDIUM: h2: don't switch the > state to HREM before end of DATA frame"). > And indeed Edge sets the ES bit in the last DATA frame of the POST issue.
They should all do that anyway since the ES bit marks the end of the stream. But it's possible there's a small difference between implementations leading to Edge triggering our bug easier. > When moving the affected HREM code above the "return 0" branch, Edge > works fine again. > > The attached patch fixes the issue for me, please give it a try. The problem with doing this is that when we have to stop transferring data because for example the target buffer is full, we'll still switch to HREM anyway and randomly destroy the last data frame. It was one of the reasons some uploads were randomly truncated. But if it fixes the issue for you, it may indicate we're not properly woken up sometimes during the upload. If I understand well, it only happens on redirects, so maybe one transition is causing trouble here, typically we may have an HLOC state (half-close(local)) when the response is sent by the server before the client finishes to upload, and it's possible that we don't continue to drain pending data there. With your change it likely causes the stream to be aborted on this last frame, unblocking the situation. That's just a wild guess, as usual :-/ Willy

