Skip to content

Commit

Permalink
Merge pull request #2129 from Shohou/2121_subscription_for_id
Browse files Browse the repository at this point in the history
#2121 - clear subscriptionForId map after websocket disconnects
  • Loading branch information
gtebrean authored Dec 17, 2024
2 parents bc6eda5 + ae3edeb commit 286b63d
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 286b63d

Please sign in to comment.