1. Alex Turcu
  2. hyflow

Commits

msaad  committed 5c1507f

Bug-Fix; Acquired objects after timeout/abort aren't released

  • Participants
  • Parent commits a4c00e6
  • Branches default

Comments (0)

Files changed (2)

File hyflow.jar

Binary file modified.

File src/java/aleph/dir/arrow/ArrowDirectory.java

View file
 import org.deuce.transaction.TransactionException;
 
 import edu.vt.rt.hyflow.HyFlow;
+import edu.vt.rt.hyflow.core.IDistinguishable;
 import edu.vt.rt.hyflow.util.io.Logger;
 
 import aleph.Aleph;
 	            wait( TIMEOUT + (int)(Math.random()*RANDOM_TIMEOUT) );  
 	            if(context.aborted){
 	            	Logger.info("Transaction meanwhile Aborted :" + context);
+	            	release((IDistinguishable)status.object);
 	            	throw new TransactionException();
 	            }
 	            if ( ( System.currentTimeMillis() - start ) >= TIMEOUT ){
 	            	Logger.info("Transaction Timeout :" + context);
+	            	release((IDistinguishable)status.object);
 	            	throw new TransactionException();
 	            }
 	        } catch (InterruptedException e) {}