mirror of https://github.com/apache/activemq.git
AMQ-8287 - fix NIOSSLTransport deadlock with serviceRead lock
This narrows the lock that was added to serviceRead() to secureRead()
which prevents processing commands while locked which should solve the
deadlock issues
(cherry picked from commit 2fcf2fd75f
)
This commit is contained in:
parent
7521d49402
commit
0f952f72f7
|
@ -158,9 +158,8 @@ public class AutoInitNioSSLTransport extends NIOSSLTransport {
|
|||
return readSize;
|
||||
}
|
||||
|
||||
//Prevent concurrent access to SSLEngine
|
||||
@Override
|
||||
public synchronized void serviceRead() {
|
||||
public void serviceRead() {
|
||||
try {
|
||||
if (handshakeInProgress) {
|
||||
doHandshake();
|
||||
|
|
|
@ -243,9 +243,8 @@ public class NIOSSLTransport extends NIOTransport {
|
|||
}
|
||||
}
|
||||
|
||||
//Prevent concurrent access to SSLEngine
|
||||
@Override
|
||||
public synchronized void serviceRead() {
|
||||
public void serviceRead() {
|
||||
try {
|
||||
if (handshakeInProgress) {
|
||||
doHandshake();
|
||||
|
@ -374,7 +373,8 @@ public class NIOSSLTransport extends NIOTransport {
|
|||
}
|
||||
}
|
||||
|
||||
protected int secureRead(ByteBuffer plain) throws Exception {
|
||||
//Prevent concurrent access while reading from the channel
|
||||
protected synchronized int secureRead(ByteBuffer plain) throws Exception {
|
||||
|
||||
if (!(inputBuffer.position() != 0 && inputBuffer.hasRemaining()) || status == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
|
||||
int bytesRead = channel.read(inputBuffer);
|
||||
|
|
Loading…
Reference in New Issue