ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mckie...@apache.org
Subject svn commit: r590968 - /webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java
Date Thu, 01 Nov 2007 11:50:20 GMT
Author: mckierna
Date: Thu Nov  1 04:50:14 2007
New Revision: 590968

URL: http://svn.apache.org/viewvc?rev=590968&view=rev
Log:
Debug for potential complex deadlocks

Modified:
    webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java

Modified: webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java?rev=590968&r1=590967&r2=590968&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java
(original)
+++ webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/storage/inmemory/InMemoryTransaction.java
Thu Nov  1 04:50:14 2007
@@ -104,14 +104,23 @@
 							other = other.waitingForTran;
 						}
 					}
-
+					
+					boolean warn = false;
 					try {
 						if(log.isDebugEnabled()) log.debug("This " + this + " waiting for " + waitingForTran);
-						bean.wait();
+						long pre = System.currentTimeMillis();
+						bean.wait(5000); 
+						long post = System.currentTimeMillis();
+						if ((post - pre) > 50000)
+							warn = true;
 					} catch(InterruptedException e) {
 						// Do nothing
 					}
 					other = (InMemoryTransaction) bean.getTransaction();
+					if (other != null && warn) {
+						//we have been waiting for a long time - this might imply a three way deadlock so error
condition
+						if(log.isDebugEnabled()) log.debug("possible deadlock :" + this.toString() + " : "
+ bean.toString());
+					}
 				}
 				
 				waitingForTran = null;



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org


Mime
View raw message