tomaswolf commented on pull request #156: URL: https://github.com/apache/mina-sshd/pull/156#issuecomment-668882088
Sorry, that doesn't change anything. The following sequence is still possible: exceptionCaught: calls authFutureHolder.get(), gets the InitialAuthFuture auth: calls prev = authFutureHolder.getAndSet(authFuture), gets the InitialAuthFuture auth: calls prev.getException(), gets null signalAuthFailure: calls setException() on the InitialAuthFuture. The authFuture must be volatile (or an AtomicReference) not because of this race that's causing problems here, but because of the only partially synchronized accesses. To avoid the race, the _pairs_ of getting/setting the authFuture _and_ getting/setting the exception must be synchronized together. That was the point of my change. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
