Skip to content

Commit

Permalink
fixup! Ensure that Task SDK supervisor closes all its handles correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashb committed Nov 21, 2024
1 parent 3cca463 commit e07dd99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions task_sdk/src/airflow/sdk/execution_time/supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def _reopen_std_io_handles(child_stdin, child_stdout, child_stderr):
try:
fd = handle.fileno()
os.dup2(sock.fileno(), fd)
# dup2 creates another open copy of the fh, we can close the "socket" copy of it.
# dup2 creates another open copy of the fd, we can close the "socket" copy of it.
sock.close()
except io.UnsupportedOperation:
if "PYTEST_CURRENT_TEST" in os.environ:
Expand Down Expand Up @@ -203,7 +203,7 @@ def exit(n: int) -> NoReturn:
sys.stdout.flush()
with suppress(ValueError, OSError):
sys.stderr.flush()
with suppress(ValueError, OSError, AttributeError):
with suppress(ValueError, OSError):
last_chance_stderr.flush()
os._exit(n)

Expand Down

0 comments on commit e07dd99

Please sign in to comment.