artembilan opened a new issue, #700:
URL: https://github.com/apache/mina-sshd/issues/700
### Version
2.15.0
### Bug description
The code there is like this:
```
protected void doCloseImmediately() {
closeFuture.setClosed();
state.set(State.Closed);
}
```
So, we fulfill `CloseFuture` first, and then set the state to `Closed`.
This way `Closeable.close(Closeable closeable)` exits earlier than we mark
that `Closeable` as `Closed`.
### Actual behavior
In my case the unit test is failing sporadically for this:
```
session.close();
assertThat(clientSession.isClosed()).isTrue();
```
### Expected behavior
The `AbstractCloseable.doCloseImmediately()` has those expressions swapped:
```
protected void doCloseImmediately() {
state.set(State.Closed);
closeFuture.setClosed();
}
```
### Relevant log output
```Shell
```
### Other information
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]