mirror of https://github.com/apache/activemq.git
Allow a blocked thread to unwind if it's connection is getting terminated.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@599835 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
27dff3538c
commit
d83969f6a8
|
@ -449,7 +449,11 @@ public class Queue extends BaseDestination implements Task {
|
|||
final ConnectionContext context = producerExchange.getConnectionContext();
|
||||
message.setRegionDestination(this);
|
||||
if (store != null && message.isPersistent()) {
|
||||
systemUsage.getStoreUsage().waitForSpace();
|
||||
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
|
||||
if (context.getStopping().get()) {
|
||||
throw new IOException("Connection closed, send aborted.");
|
||||
}
|
||||
}
|
||||
store.addMessage(context, message);
|
||||
}
|
||||
if (context.isInTransaction()) {
|
||||
|
|
|
@ -388,7 +388,11 @@ public class Topic extends BaseDestination implements Task{
|
|||
message.setRegionDestination(this);
|
||||
|
||||
if (store != null && message.isPersistent() && !canOptimizeOutPersistence()) {
|
||||
systemUsage.getStoreUsage().waitForSpace();
|
||||
while (!systemUsage.getStoreUsage().waitForSpace(1000)) {
|
||||
if (context.getStopping().get()) {
|
||||
throw new IOException("Connection closed, send aborted.");
|
||||
}
|
||||
}
|
||||
store.addMessage(context, message);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue