From: <dm...@us...> - 2010-11-01 17:48:38
|
Revision: 3857 http://bigdata.svn.sourceforge.net/bigdata/?rev=3857&view=rev Author: dmacgbr Date: 2010-11-01 17:48:31 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Modify processing of shutdown and halt states of inner class AcceptTask to ensure that all resources are tidied up. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java 2010-11-01 16:01:41 UTC (rev 3856) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java 2010-11-01 17:48:31 UTC (rev 3857) @@ -29,6 +29,7 @@ import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Running; import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Shutdown; +import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.ShutdownNow; import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Starting; import java.lang.ref.WeakReference; @@ -58,6 +59,8 @@ import org.apache.log4j.Logger; import com.bigdata.cache.ConcurrentWeakValueCacheWithTimeout; +import com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.LockFutureTask; +import com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ResourceQueue; import com.bigdata.counters.CounterSet; import com.bigdata.counters.Instrument; import com.bigdata.journal.AbstractTask; @@ -2098,7 +2101,7 @@ log.info(lockManager.serviceRunState); } // Done. - return; + awaitStateChange(ShutdownNow); } finally { lockManager.lock.unlock(); } @@ -2106,6 +2109,8 @@ case Halted: { if (INFO) log.info(lockManager.serviceRunState); + // stop the service running for this task. + lockManager.service.shutdown () ; // Done. return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tho...@us...> - 2010-11-01 19:06:54
|
Revision: 3859 http://bigdata.svn.sourceforge.net/bigdata/?rev=3859&view=rev Author: thompsonbry Date: 2010-11-01 19:06:48 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Reviewing the changes to the NonBlockingLockManagerWithNewDesign, it seems to me that line 2100 should be: // One more time through the loop to exit @ Halted. continue; Rather than: // Done. awaitStateChange(ShutdownNow); The awaitStateChange(ShutdownNow) call at 2100 in your edit will return immediately since the expected run state was just set to Halted a few lines above in the file. It is as far as I can tell a NOP. However, the "continue" will reenter the loop at the top, observe the Halted run state, and then execute the case for "Halted" which shuts down the service running the AcceptTask. Modified Paths: -------------- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java Modified: branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java =================================================================== --- branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java 2010-11-01 18:51:08 UTC (rev 3858) +++ branches/QUADS_QUERY_BRANCH/bigdata/src/java/com/bigdata/concurrent/NonBlockingLockManagerWithNewDesign.java 2010-11-01 19:06:48 UTC (rev 3859) @@ -29,7 +29,6 @@ import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Running; import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Shutdown; -import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.ShutdownNow; import static com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ServiceRunState.Starting; import java.lang.ref.WeakReference; @@ -59,8 +58,6 @@ import org.apache.log4j.Logger; import com.bigdata.cache.ConcurrentWeakValueCacheWithTimeout; -import com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.LockFutureTask; -import com.bigdata.concurrent.NonBlockingLockManagerWithNewDesign.ResourceQueue; import com.bigdata.counters.CounterSet; import com.bigdata.counters.Instrument; import com.bigdata.journal.AbstractTask; @@ -2100,8 +2097,8 @@ if (INFO) log.info(lockManager.serviceRunState); } - // Done. - awaitStateChange(ShutdownNow); + // One more time through the loop to exit @ Halted. + continue; } finally { lockManager.lock.unlock(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |