Skip to content

Commit d906619

Browse files
authored
more resiliancy (#4395)
1 parent 03b42a6 commit d906619

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/toil/fileStores/nonCachingFileStore.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ def open(self, job: Job) -> Generator[None, None, None]:
126126
os.chdir(startingDir)
127127
# Finally delete the job from the worker
128128
self.check_for_state_corruption()
129-
os.remove(self.jobStateFile)
129+
try:
130+
os.remove(self.jobStateFile)
131+
except FileNotFoundError:
132+
logger.exception('Job state file %s has gone missing unexpectedly; some cleanup for failed jobs may be getting skipped!', self.jobStateFile)
133+
pass
130134

131135
def writeGlobalFile(self, localFileName: str, cleanup: bool=False) -> FileID:
132136
absLocalFileName = self._resolveAbsoluteLocalPath(localFileName)

src/toil/statsAndLogging.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def callback(fileHandle: Union[IO[bytes], IO[str]]) -> None:
148148
if not isinstance(statsStr, str):
149149
statsStr = statsStr.decode()
150150
stats = json.loads(statsStr, object_hook=Expando)
151+
if not stats:
152+
return
151153
try:
152154
logs = stats.workers.logsToMaster
153155
except AttributeError:

0 commit comments

Comments
 (0)