File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -275,9 +275,18 @@ def hash_exists(self, updatehash=False):
275
275
logger .debug ('Node hash value: %s' , hashvalue )
276
276
277
277
if op .exists (outdir ):
278
+ # Find unfinished hashfiles and error if any
279
+ unfinished = glob (op .join (outdir , '_0x*_unfinished.json' ))
280
+ if unfinished :
281
+ raise RuntimeError (
282
+ '[Caching Node Error] Found unfinished hashfiles (%d) that indicate '
283
+ 'that the ``base_dir`` for this node went stale. Please re-run the '
284
+ 'workflow.' % len (unfinished ))
285
+
278
286
# Find previous hashfiles
279
287
hashfiles = glob (op .join (outdir , '_0x*.json' ))
280
- if len (hashfiles ) > 1 : # Remove hashfiles if more than one found
288
+ # Remove hashfiles if more than one found or the one found is outdated
289
+ if hashfiles and (len (hashfiles ) > 1 or hashfiles [0 ] != hashfile ):
281
290
logger .info ('Removing hashfiles (%s) and forcing node to rerun' ,
282
291
', ' .join (['"%s"' % op .basename (h ) for h in hashfiles ]))
283
292
for hf in hashfiles :
You can’t perform that action at this time.
0 commit comments