Index: /trunk/pstamp/scripts/pstamp_checkdependent.pl
===================================================================
--- /trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 34594)
+++ /trunk/pstamp/scripts/pstamp_checkdependent.pl	(revision 34595)
@@ -262,7 +262,9 @@
         } elsif ($chip->{state} eq 'goto_cleaned') {
 
-            if ($chip->{data_state} eq 'full') {
-                # cleanup has been queued, but has not yet finished. (cleanup pantasks is probably stopped)
-                # Since this chip is in full go ahead and set the run to state update and change the label.
+            # we don't need to check for full data_state
+            # if ($chip->{data_state} eq 'full') {
+            {
+                # cleanup must not be running. Set state to update. If this chip is not 'full' it will be
+                # set to be updated the next time this script is invoked
                 # XXX: In the very rare case that this chip run is actually in the running cleanup pantasks
                 # queue things may get confused but we can live with that
@@ -365,7 +367,9 @@
     my $skycell = $metadata;
 
-    if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') {
-        # cleanup has been queued, but hasn't been done. it's "safe" to set the state back to full
-        # XXX: seem comments in check_states_chip
+    # if ($skycell->{state} eq 'goto_cleaned' and $skycell->{data_state} eq 'full') {
+    if ($skycell->{state} eq 'goto_cleaned') {
+        # cleanup has been queued, but hasn't finished, probably due to an error or cleanup is not running.
+        # It's "safe" to set the state to update. If the skycell is not full it will be set to update
+        # the next time this task runs
         my $command = "$warptool -updaterun -set_state update -warp_id $warp_id";
         $command .= " -set_label $rlabel" if $rlabel;
@@ -468,5 +472,8 @@
     my $skycell_id = $skycell->{skycell_id};
 
-    if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {
+    # if ($metadata->{state} eq 'goto_cleaned' and $metadata->{data_state} eq 'full') {
+    if ($metadata->{state} eq 'goto_cleaned') {
+        # cleanup must not be running. Set state to update. If the skycell is not 'full' it will be
+        # set to be updated the next time this script is invoked
         print "changing state of diffRun $diff_id from goto_cleaned to update. skycell $skycell_id is full\n";
         my $command = "$difftool -updaterun -set_state update -diff_id $diff_id";
