@@ -144,6 +144,8 @@ public void onNext(Payload p) {
144144 final ByteBuf errorFrame = ErrorFrameCodec .encode (allocator , streamId , e );
145145 sender .sendFrame (streamId , errorFrame );
146146
147+ this .requesterResponderSupport .remove (streamId , this );
148+
147149 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
148150 if (requestInterceptor != null ) {
149151 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -162,6 +164,8 @@ public void onNext(Payload p) {
162164 new CanceledException ("Failed to validate payload. Cause" + e .getMessage ()));
163165 sender .sendFrame (streamId , errorFrame );
164166
167+ this .requesterResponderSupport .remove (streamId , this );
168+
165169 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
166170 if (requestInterceptor != null ) {
167171 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -176,6 +180,8 @@ public void onNext(Payload p) {
176180 return ;
177181 }
178182
183+ this .requesterResponderSupport .remove (streamId , this );
184+
179185 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
180186 if (requestInterceptor != null ) {
181187 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
@@ -195,8 +201,6 @@ boolean tryTerminateOnError() {
195201 return false ;
196202 }
197203
198- this .requesterResponderSupport .remove (this .streamId , this );
199-
200204 currentSubscription .cancel ();
201205
202206 return true ;
@@ -222,11 +226,12 @@ public void onError(Throwable t) {
222226 }
223227
224228 final int streamId = this .streamId ;
225- this .requesterResponderSupport .remove (streamId , this );
226229
227230 final ByteBuf errorFrame = ErrorFrameCodec .encode (this .allocator , streamId , t );
228231 this .connection .sendFrame (streamId , errorFrame );
229232
233+ this .requesterResponderSupport .remove (streamId , this );
234+
230235 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
231236 if (requestInterceptor != null ) {
232237 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
@@ -246,11 +251,12 @@ public void onComplete() {
246251 }
247252
248253 final int streamId = this .streamId ;
249- this .requesterResponderSupport .remove (streamId , this );
250254
251255 final ByteBuf completeFrame = PayloadFrameCodec .encodeComplete (this .allocator , streamId );
252256 this .connection .sendFrame (streamId , completeFrame );
253257
258+ this .requesterResponderSupport .remove (streamId , this );
259+
254260 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
255261 if (requestInterceptor != null ) {
256262 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , null );
@@ -321,7 +327,6 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
321327 S .lazySet (this , Operators .cancelledSubscription ());
322328
323329 final int streamId = this .streamId ;
324- this .requesterResponderSupport .remove (streamId , this );
325330
326331 this .frames = null ;
327332 frames .release ();
@@ -334,6 +339,8 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
334339 new CanceledException ("Failed to reassemble payload. Cause: " + e .getMessage ()));
335340 this .connection .sendFrame (streamId , errorFrame );
336341
342+ this .requesterResponderSupport .remove (streamId , this );
343+
337344 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
338345 if (requestInterceptor != null ) {
339346 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -354,7 +361,6 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
354361 this .done = true ;
355362
356363 final int streamId = this .streamId ;
357- this .requesterResponderSupport .remove (streamId , this );
358364
359365 ReferenceCountUtil .safeRelease (frames );
360366
@@ -366,6 +372,8 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
366372 new CanceledException ("Failed to reassemble payload. Cause: " + t .getMessage ()));
367373 this .connection .sendFrame (streamId , errorFrame );
368374
375+ this .requesterResponderSupport .remove (streamId , this );
376+
369377 final RequestInterceptor requestInterceptor = this .requestInterceptor ;
370378 if (requestInterceptor != null ) {
371379 requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
0 commit comments