reactor-netty: [HTTP2] bodyToMono waiting for data frame indefinitely #2

Hello, I’m back again with another http2 issue 😦

Expected Behavior

Return the request’s body

Actual Behavior

ServerRequest.bodyToMono waits indefinitely for data even though data was sent

Steps to Reproduce

  • create an HTTP2 server (H2C in my case, https://github.com/Tiller/netty-leaks simply start Application.java)
  • create a controller + endpoint that takes a ServerRequest as a parameter and reads its body
  • call bodyToMono on the ServerRequest
  • with some http2 client, call the endpoint POST ‘/tap/operation’ (cd client ; npm install && node test.js)

Possible Solution

Not really a possible solution, but a beginning of analysis.

When executing the following command:

echo '{"hello":"world"}' | nghttp -H':method: POST' -H'content-type: application/json' http://localhost:8081/tap/operation -d -

It works as expected. However, when running the JS client included in my github repository, which basically does the same request it fails and my bodyToMono times out

I dumped the network exchanges of both requests (see attachment) and I see one main difference:

  • nghttp sends a HEADER frame, followed by a DATA frame containing the json with flag endOfStream
  • the JS client sends a HEADER frame, following by a DATA frame containing the json withOUT flag endOfStream then sends another DATA frame with flag endOfStream

edit: could not attach dump, here it is: https://stuff.stooit.com/d/1/5e843f10f0f23/http2.pcap

I’d say that even if the JS exchange could be optimized, it is still a valid HTTP2 exchange and it should work as intended (note: afaik, it worked with 0.9.0.RC1)

Your Environment

OS: Xubuntu 19.10 64bits 5.3.0-42-generic JVM: openjdk version “11.0.6” 2020-01-14 Reactor: 3.3.2.RELEASE Spring-boot: 2.2.4.RELEASE Reactor-netty: 0.9.4.RELEASE (tried with 0.9.6.RELEASE and same behavior is observed) Netty: 4.1.45.Final (tried with 4.1.48.Final and the same behavior is observed)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

It works! Thanks 😃

Just fyi, I tried to send 3 DATA frames with a fragmented body, and I correctly received the whole body with all my chunks reunited

@violetagg thanks, but the same issue appear with netty 4.1.48.Final