Skip to content

fix: replace bare except with except Exception in task_finished#15

Open
Talha8899 wants to merge 1 commit into
outerbounds:mainfrom
Talha8899:fix/bare-except-in-task-finished
Open

fix: replace bare except with except Exception in task_finished#15
Talha8899 wants to merge 1 commit into
outerbounds:mainfrom
Talha8899:fix/bare-except-in-task-finished

Conversation

@Talha8899

Copy link
Copy Markdown
Contributor

Problem

In slurm_decorator.py, the task_finished method
uses a bare except: clause when terminating the
log sidecar:

try:
self._save_logs_sidecar.terminate()
except:
# Best effort kill
pass

A bare except: catches everything including
KeyboardInterrupt and SystemExit which should
never be silently ignored.

Fix

Replace bare except: with except Exception:
which only catches actual exceptions and lets
system signals pass through correctly.

Testing

Manually verified the change does not affect
normal execution flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant