activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r599835 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region: Queue.java Topic.java
Date Fri, 30 Nov 2007 14:42:56 GMT
Author: chirino
Date: Fri Nov 30 06:42:53 2007
New Revision: 599835

URL: http://svn.apache.org/viewvc?rev=599835&view=rev
Log:
Allow a blocked thread to unwind if it's connection is getting terminated.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java?rev=599835&r1=599834&r2=599835&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Queue.java
Fri Nov 30 06:42:53 2007
@@ -449,7 +449,11 @@
         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()) {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java?rev=599835&r1=599834&r2=599835&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Topic.java
Fri Nov 30 06:42:53 2007
@@ -388,7 +388,11 @@
         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);
         }
 



Mime
View raw message