@@ -144,6 +144,8 @@ public void onNext(Payload p) {
144
144
final ByteBuf errorFrame = ErrorFrameCodec .encode (allocator , streamId , e );
145
145
sender .sendFrame (streamId , errorFrame );
146
146
147
+ this .requesterResponderSupport .remove (streamId , this );
148
+
147
149
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
148
150
if (requestInterceptor != null ) {
149
151
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -162,6 +164,8 @@ public void onNext(Payload p) {
162
164
new CanceledException ("Failed to validate payload. Cause" + e .getMessage ()));
163
165
sender .sendFrame (streamId , errorFrame );
164
166
167
+ this .requesterResponderSupport .remove (streamId , this );
168
+
165
169
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
166
170
if (requestInterceptor != null ) {
167
171
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -176,6 +180,8 @@ public void onNext(Payload p) {
176
180
return ;
177
181
}
178
182
183
+ this .requesterResponderSupport .remove (streamId , this );
184
+
179
185
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
180
186
if (requestInterceptor != null ) {
181
187
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
@@ -195,8 +201,6 @@ boolean tryTerminateOnError() {
195
201
return false ;
196
202
}
197
203
198
- this .requesterResponderSupport .remove (this .streamId , this );
199
-
200
204
currentSubscription .cancel ();
201
205
202
206
return true ;
@@ -222,11 +226,12 @@ public void onError(Throwable t) {
222
226
}
223
227
224
228
final int streamId = this .streamId ;
225
- this .requesterResponderSupport .remove (streamId , this );
226
229
227
230
final ByteBuf errorFrame = ErrorFrameCodec .encode (this .allocator , streamId , t );
228
231
this .connection .sendFrame (streamId , errorFrame );
229
232
233
+ this .requesterResponderSupport .remove (streamId , this );
234
+
230
235
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
231
236
if (requestInterceptor != null ) {
232
237
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
@@ -246,11 +251,12 @@ public void onComplete() {
246
251
}
247
252
248
253
final int streamId = this .streamId ;
249
- this .requesterResponderSupport .remove (streamId , this );
250
254
251
255
final ByteBuf completeFrame = PayloadFrameCodec .encodeComplete (this .allocator , streamId );
252
256
this .connection .sendFrame (streamId , completeFrame );
253
257
258
+ this .requesterResponderSupport .remove (streamId , this );
259
+
254
260
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
255
261
if (requestInterceptor != null ) {
256
262
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , null );
@@ -321,7 +327,6 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
321
327
S .lazySet (this , Operators .cancelledSubscription ());
322
328
323
329
final int streamId = this .streamId ;
324
- this .requesterResponderSupport .remove (streamId , this );
325
330
326
331
this .frames = null ;
327
332
frames .release ();
@@ -334,6 +339,8 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
334
339
new CanceledException ("Failed to reassemble payload. Cause: " + e .getMessage ()));
335
340
this .connection .sendFrame (streamId , errorFrame );
336
341
342
+ this .requesterResponderSupport .remove (streamId , this );
343
+
337
344
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
338
345
if (requestInterceptor != null ) {
339
346
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , e );
@@ -354,7 +361,6 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
354
361
this .done = true ;
355
362
356
363
final int streamId = this .streamId ;
357
- this .requesterResponderSupport .remove (streamId , this );
358
364
359
365
ReferenceCountUtil .safeRelease (frames );
360
366
@@ -366,6 +372,8 @@ public void handleNext(ByteBuf followingFrame, boolean hasFollows, boolean isLas
366
372
new CanceledException ("Failed to reassemble payload. Cause: " + t .getMessage ()));
367
373
this .connection .sendFrame (streamId , errorFrame );
368
374
375
+ this .requesterResponderSupport .remove (streamId , this );
376
+
369
377
final RequestInterceptor requestInterceptor = this .requestInterceptor ;
370
378
if (requestInterceptor != null ) {
371
379
requestInterceptor .onTerminate (streamId , FrameType .REQUEST_STREAM , t );
0 commit comments