Skip to content

Commit

Permalink
Close after goaway
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkec committed Nov 21, 2023
1 parent 09d6d72 commit 87d2a2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ void updateLastStreamId(int lastStreamId) {
}

void close() {
this.goAway(0, Http2ErrorCode.NO_ERROR, "Closing connection");
if (state.getAndSet(State.CLOSED) != State.CLOSED) {
this.goAway(0, Http2ErrorCode.NO_ERROR, "Closing connection");
try {
handleTask.cancel(true);
ctx.log(LOGGER, TRACE, "Closing connection");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static Http2ConnectionCache create() {

@Override
public void closeResource() {
if (closed.getAndSet(true)) {
if (!closed.getAndSet(true)) {
List.copyOf(cache.keySet())
.forEach(this::closeAndRemove);
}
Expand Down

0 comments on commit 87d2a2c

Please sign in to comment.