File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4 Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -58,17 +58,21 @@ public void addTracingHandler(ChunkHandler chunkHandler) {
5858 tracingHandlers .add (chunkHandler );
5959 }
6060
61+ private void scheduleRead () {
62+ channel .eventLoop ().execute (channel ::read );
63+ }
64+
6165 @ Override
6266 public void next () {
6367 assert handler != null : "handler must be set before requesting next chunk" ;
6468 requestContext = threadContext .newStoredContext ();
65- channel . eventLoop (). execute ( channel :: read );
69+ scheduleRead ( );
6670 }
6771
6872 public void handleNettyContent (HttpContent httpContent ) {
6973 if (closing ) {
7074 httpContent .release ();
71- channel . eventLoop (). execute ( channel :: read );
75+ scheduleRead ( );
7276 } else {
7377 try (var ignored = threadContext .restoreExistingContext (requestContext )) {
7478 var isLast = httpContent instanceof LastHttpContent ;
@@ -78,7 +82,7 @@ public void handleNettyContent(HttpContent httpContent) {
7882 }
7983 handler .onNext (buf , isLast );
8084 if (isLast ) {
81- channel . read ();
85+ scheduleRead ();
8286 channel .closeFuture ().removeListener (closeListener );
8387 }
8488 }
@@ -104,6 +108,6 @@ private void doClose() {
104108 handler .close ();
105109 }
106110 }
107- channel . eventLoop (). execute ( channel :: read );
111+ scheduleRead ( );
108112 }
109113}
You can’t perform that action at this time.
0 commit comments