Skip to content

Commit

Permalink
fix: Propagate SIGINT to subprocess (#75)
Browse files Browse the repository at this point in the history
Co-authored-by: Will Da Silva <[email protected]>
  • Loading branch information
ReubenFrankel and WillDaSilva authored Nov 29, 2023
1 parent c6f5c0b commit 191b227
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions meltano/edk/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import asyncio
import os
import signal
import subprocess
import typing as t

Expand Down Expand Up @@ -132,6 +133,12 @@ async def _exec(
env=self.popen_env,
)

loop = asyncio.get_event_loop()
loop.add_signal_handler(
signal.SIGINT,
lambda s=signal.SIGINT: p.send_signal(s),
)

streams: list[asyncio.streams.StreamReader] = []

if p.stderr:
Expand Down

0 comments on commit 191b227

Please sign in to comment.