Skip to content

Commit

Permalink
#2121 - clear subscriptionForId map after websocket disconnects
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Shohov <[email protected]>
  • Loading branch information
Shohou committed Dec 17, 2024
1 parent 6e553a5 commit ae3edeb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

* fixed several code issues found by sonar [#2113](https://github.com/hyperledger/web3j/pull/2113)
* update GitHub actions versions [#2114](https://github.com/hyperledger/web3j/pull/2114)
* fixed subscription object leaking after disconnect [#2121](https://github.com/hyperledger/web3j/pull/2121)

### Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ private void closeOutstandingRequests() {
request.getOnReply()
.completeExceptionally(
new IOException("Connection was closed")));
requestForId.clear();
}

private void closeOutstandingSubscriptions() {
Expand All @@ -567,6 +568,7 @@ private void closeOutstandingSubscriptions() {
subscription
.getSubject()
.onError(new IOException("Connection was closed")));
subscriptionForId.clear();
}

// Method visible for unit-tests
Expand Down

0 comments on commit ae3edeb

Please sign in to comment.