Skip to content

Commit

Permalink
cleanup tmp status-cache files. Fix dmwm#5128
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte committed Dec 8, 2021
1 parent b79c77b commit ecd1e81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/python/CRABClient/Commands/status.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import division # I want floating points
from __future__ import print_function

import os
import pickle
import sys
import math
Expand Down Expand Up @@ -126,6 +127,8 @@ def __call__(self):
raise Exception("failed to retrieve %s" % url)
with open(local_status_cache_pkl, PKL_R_MODE) as fp:
statusCache = pickle.load(fp)
fp.close()
os.remove(local_status_cache_pkl)
if 'bootstrapTime' in statusCache :
statusCacheInfo_PKL = None
bootstrapMsg_PKL = "Task bootstrapped at %s" % statusCache['bootstrapTime']['date']
Expand All @@ -151,6 +154,8 @@ def __call__(self):
raise Exception("failed to retrieve %s" % url)
with open(local_status_cache_txt, 'r') as fp:
statusCacheData = fp.read()
fp.close()
os.remove(local_status_cache_txt)
# Normally the first two lines of the file contain the checkpoint locations
# for the job_log / fjr_parse_results files and are used by the status caching script.
# But if the job has just bootstrapped the first lines of the file are:
Expand Down

0 comments on commit ecd1e81

Please sign in to comment.