Skip to content

Commit

Permalink
Fixed problem with out/err
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Nilsson committed Dec 10, 2024
1 parent 699f724 commit 077148f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pilot/control/payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,16 @@ def execute_payloads(queues: namedtuple, traces: Any, args: object): # noqa: C9
job.t0 = os.times()
exit_code, diagnostics = payload_executor.run()
if exit_code and exit_code > 1000: # pilot error code, add to list
logger.debug(f'pilot error code received (code={exit_code}, diagnostics=\n{diagnostics})')
logger.warning(f'pilot error code received (code={exit_code}, diagnostics=\n{diagnostics})')
job.piloterrorcodes, job.piloterrordiags = errors.add_error_code(exit_code, msg=diagnostics)

logger.debug(f'run() returned exit_code={exit_code}')
set_cpu_consumption_time(job)
job.transexitcode = exit_code % 255
out.close()
err.close()
if out:
out.close()
if err:
err.close()

# some HPO jobs will produce new output files (following lfn name pattern), discover those and replace the job.outdata list
pilot_user = os.environ.get('PILOT_USER', 'generic').lower()
Expand Down

0 comments on commit 077148f

Please sign in to comment.