From cb5aac620cccde3c4074ef7f06d3ce2ef9aaf9aa Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Wed, 23 Dec 2009 19:58:34 +0000 Subject: [PATCH] It looks very much to me like we were able to occasionally sneak by the checks and shutdown the omgr too early in the following condition: - PresentsInvoker decides it's empty - It waits on other dependencies - During the wait, something (probably from one of the other dependencies) posts to the PresentsInvoker - We loop back around, the dependencies are empty - We end early, with the posted bit still to be done... So... after waiting, do a quick check for emptyness and if not satisfied, start the whole dern cycle over. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6005 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/server/PresentsInvoker.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/java/com/threerings/presents/server/PresentsInvoker.java b/src/java/com/threerings/presents/server/PresentsInvoker.java index 0cec089df..2be37cd7b 100644 --- a/src/java/com/threerings/presents/server/PresentsInvoker.java +++ b/src/java/com/threerings/presents/server/PresentsInvoker.java @@ -157,6 +157,17 @@ public class PresentsInvoker extends ReportingInvoker } catch (InterruptedException e) { // Not a problem, we'll just check on the checkers again } + + // While we were waiting on the various invokers, one of them might have + // given us something to do, in which case we really shouldn't be + // continuing on with this... + if (getPendingUnits() > 0) { + _loopCount++; + releaseCheckers(checkers); + postUnit(this); + return false; + } + } else { // All the checkers are blocking their respective threads. That means // if their queues are empty, nothing else is running.