Netty push promise with HttpToHttp2ConnectionHandler #13652
Unanswered
isaacrivriv
asked this question in
Q&A
Replies: 1 comment
-
Still have some doubts about this, can anyone please add some details here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, there! I have a question related to an issue I'm hitting while doing push promise.
We're using the HttpToHttp2ConnectionHandler with the InboundHttp2ToHttpAdapter for handling HTTP2 traffic in a server that handles both HTTP1.1 and HTTP2 requests. Each request that comes in is handled in a separate thread outside the EventLoop.
I'm receiving a request that involves starting a push from the server. The server starts handling the request calling writeAndFlush to the headers and then creating the necessary metadata for the push promise. Since the handler itself does not handle push promise that I can see, we get the encoder from the pipeline and call writePushPromise from it as summarized below.
However, while testing, we see that we're not getting the appropriate headers back on either the push promise or the header frame. From the FrameLogger logs, everything looks to be okay but on a packet capture that headers are not properly sent. We can see the headers are intermingled between the header response and the push promise headers.
As I was debugging, I realized that there seems to be a concurrency issue while calling writePushPromise encoding the headers and while the writeAndFlush calls writeHeadersInternal to encode headers. As a quick test, I added a sync block for that line which seems to fix the issue.
My question is, is this be an issue that should be fixed or is this by design that the methods should be called only from the event loop thread? If so, are there any recommendations as to how to proceed?
Beta Was this translation helpful? Give feedback.
All reactions