mirror of https://github.com/apache/activemq.git
Revert "AMQ-6494 Return ExceptionResponse during broker service shutdown"
the root cause seems to be in the vm transport iterator
This reverts commit dce2b61f87
.
This commit is contained in:
parent
c1cbf509da
commit
0f7561e85a
|
@ -101,6 +101,7 @@ import org.apache.activemq.transport.TransportDisposedIOException;
|
||||||
import org.apache.activemq.util.IntrospectionSupport;
|
import org.apache.activemq.util.IntrospectionSupport;
|
||||||
import org.apache.activemq.util.MarshallingSupport;
|
import org.apache.activemq.util.MarshallingSupport;
|
||||||
import org.apache.activemq.util.NetworkBridgeUtils;
|
import org.apache.activemq.util.NetworkBridgeUtils;
|
||||||
|
import org.apache.activemq.util.SubscriptionKey;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
|
@ -189,10 +190,14 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
throw new RuntimeException("Protocol violation - Command corrupted: " + o.toString());
|
throw new RuntimeException("Protocol violation - Command corrupted: " + o.toString());
|
||||||
}
|
}
|
||||||
Command command = (Command) o;
|
Command command = (Command) o;
|
||||||
|
if (!brokerService.isStopping()) {
|
||||||
Response response = service(command);
|
Response response = service(command);
|
||||||
if (response != null) {
|
if (response != null && !brokerService.isStopping()) {
|
||||||
dispatchSync(response);
|
dispatchSync(response);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new BrokerStoppedException("Broker " + brokerService + " is being stopped");
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
serviceLock.readLock().unlock();
|
serviceLock.readLock().unlock();
|
||||||
}
|
}
|
||||||
|
@ -321,13 +326,10 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
boolean responseRequired = command.isResponseRequired();
|
boolean responseRequired = command.isResponseRequired();
|
||||||
int commandId = command.getCommandId();
|
int commandId = command.getCommandId();
|
||||||
try {
|
try {
|
||||||
if (brokerService.isStopping()) {
|
if (!pendingStop.get()) {
|
||||||
response = responseRequired ? new ExceptionResponse(
|
|
||||||
new BrokerStoppedException("Broker " + brokerService + " is being stopped")) : null;
|
|
||||||
} else if (!pendingStop.get()) {
|
|
||||||
response = command.visit(this);
|
response = command.visit(this);
|
||||||
} else {
|
} else {
|
||||||
response = responseRequired ? new ExceptionResponse(transportException.get()) : null;
|
response = new ExceptionResponse(transportException.get());
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (SERVICELOG.isDebugEnabled() && e.getClass() != BrokerStoppedException.class) {
|
if (SERVICELOG.isDebugEnabled() && e.getClass() != BrokerStoppedException.class) {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
<!--
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
|
Loading…
Reference in New Issue