Skip to content

Commit

Permalink
fix: moving source close to the executor (just like doConsume)
Browse files Browse the repository at this point in the history
close: #6354

Signed-off-by: Steve Hawkins <[email protected]>
Signed-off-by: Marc Nuri <[email protected]>
  • Loading branch information
shawkins authored and manusa committed Sep 25, 2024
1 parent 928d356 commit 71354a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#### Bugs
* Fix #6247: Support for proxy authentication from proxy URL user info
* Fix #6342: UnmatchedFieldTypeModule prevents certain jackson features from working
* Fix #6354: Prevent deadlock in okhttp AsyncBody.cancel

### 6.13.3 (2024-08-13)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ public CompletableFuture<Void> done() {

@Override
public void cancel() {
Utils.closeQuietly(source);
// closing from a non dispatcher thread risks deadlock because close is
// a long-running operation that may need to re-obtain the dispatcher lock
// and the thread may already be holding other locks
executor.execute(() -> Utils.closeQuietly(source));
done.cancel(false);
}
}
Expand Down

0 comments on commit 71354a8

Please sign in to comment.