Skip to content

Commit

Permalink
more resiliancy (#4395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-c authored Dec 1, 2023
1 parent 03b42a6 commit d906619
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/toil/fileStores/nonCachingFileStore.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ def open(self, job: Job) -> Generator[None, None, None]:
os.chdir(startingDir)
# Finally delete the job from the worker
self.check_for_state_corruption()
os.remove(self.jobStateFile)
try:
os.remove(self.jobStateFile)
except FileNotFoundError:
logger.exception('Job state file %s has gone missing unexpectedly; some cleanup for failed jobs may be getting skipped!', self.jobStateFile)
pass

def writeGlobalFile(self, localFileName: str, cleanup: bool=False) -> FileID:
absLocalFileName = self._resolveAbsoluteLocalPath(localFileName)
Expand Down
2 changes: 2 additions & 0 deletions src/toil/statsAndLogging.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ def callback(fileHandle: Union[IO[bytes], IO[str]]) -> None:
if not isinstance(statsStr, str):
statsStr = statsStr.decode()
stats = json.loads(statsStr, object_hook=Expando)
if not stats:
return
try:
logs = stats.workers.logsToMaster
except AttributeError:
Expand Down

0 comments on commit d906619

Please sign in to comment.