When not using file_per_task, make sure we don't prematurely close the perf files (#56477)
* When not using file_per_task, make sure we don't prematurely close the perf files * add changelog fragment
This commit is contained in:
parent
98246f6032
commit
867e357eb1
2 changed files with 11 additions and 8 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- cgroup_perf_recap - When not using file_per_task, make sure we don't prematurely close the perf files
|
|
@ -394,13 +394,14 @@ class CallbackModule(CallbackBase):
|
|||
def _profile(self, obj=None):
|
||||
prev_task = None
|
||||
results = dict.fromkeys(self._features)
|
||||
for dummy, f in self._files.items():
|
||||
if f is None:
|
||||
continue
|
||||
try:
|
||||
f.close()
|
||||
except Exception:
|
||||
pass
|
||||
if not obj or self._file_per_task:
|
||||
for dummy, f in self._files.items():
|
||||
if f is None:
|
||||
continue
|
||||
try:
|
||||
f.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
for name, prof in self._profilers.items():
|
||||
|
@ -420,7 +421,7 @@ class CallbackModule(CallbackBase):
|
|||
pass
|
||||
|
||||
if obj is not None:
|
||||
if self._file_per_task:
|
||||
if self._file_per_task or self._counter == 0:
|
||||
self._open_files(task_uuid=obj._uuid)
|
||||
|
||||
for feature in self._features:
|
||||
|
|
Loading…
Reference in a new issue