Skip to content

Commit 9bd0ec3

Browse files
committed
Release cached item in ChannelSendOperator when server error
Related to gh-22720
1 parent 9c48d63 commit 9bd0ec3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

spring-web/src/main/java/org/springframework/http/server/reactive/ChannelSendOperator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,12 @@ public void onNext(Void aVoid) {
394394

395395
@Override
396396
public void onError(Throwable ex) {
397-
this.completionSubscriber.onError(ex);
397+
try {
398+
this.completionSubscriber.onError(ex);
399+
}
400+
finally {
401+
this.writeBarrier.releaseCachedItem();
402+
}
398403
}
399404

400405
@Override

0 commit comments

Comments
 (0)