full-toothbrush-75676
11/18/2021, 7:35 PMpants run
on a pex_binary
that runs gunicorn
and have noticed that Pants doesn’t stop the pex process after I interrupt it with ctrl + c. Has anyone run into something similar in the past? (Am I missing something obvious?)./pants run \
:main-gunicorn --loop -- \
main:app --preload -k uvicorn.workers.UvicornWorker
And here’s the relevant BUILD
file:
files(name="gunicorn-config", sources=["gunicorn_config.py"])
pex_binary(
name="main-gunicorn",
# Note: Explicitly include runtime dependencies that are used in a deployed setting.
dependencies=["//3rdparty:gunicorn", "//3rdparty:uvicorn", ":main"],
script="gunicorn",
restartable=True,
)
[2021-11-18 11:32:46 -0800] [39421] [INFO] Starting gunicorn 19.10.0
[2021-11-18 11:32:46 -0800] [39421] [INFO] Listening at: <http://127.0.0.1:8000> (39421)
[2021-11-18 11:32:46 -0800] [39421] [INFO] Using worker: uvicorn.workers.UvicornWorker
/Users/smacpher/.pyenv/versions/3.8.9/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
return io.open(fd, *args, **kwargs)
[2021-11-18 11:32:46 -0800] [39447] [INFO] Booting worker with pid: 39447
[2021-11-18 11:32:47 -0800] [39447] [INFO] Started server process [39447]
[2021-11-18 11:32:47 -0800] [39447] [INFO] Waiting for application startup.
[2021-11-18 11:32:47 -0800] [39447] [INFO] Application startup complete.
^D
^CInterrupted by user.
I see:
ps aux | grep python
smacpher 39447 0.1 0.2 5015440 34008 ?? S 11:32AM 0:00.09 /Users/smacpher/.pyenv/versions/3.8.9/bin/python3.8 /Users/smacpher/.cache/pants/named_caches/pex_root/unzipped_pexes/4fa0d590ec73dc2e18ee7c83d723aa58e1bd95b8 main:app --preload -k uvicorn.workers.UvicornWorker
witty-crayon-22786
11/18/2021, 7:39 PMfull-toothbrush-75676
11/18/2021, 7:44 PM2.9.0.dev1
I just bumped the version; this was happening on 2.8.0
as well though 😕witty-crayon-22786
11/18/2021, 7:45 PMfull-toothbrush-75676
11/18/2021, 7:45 PMhappy-kitchen-89482
11/18/2021, 8:27 PMwitty-crayon-22786
11/18/2021, 10:43 PMPANTS_SHA=8826bf0dad72c74e2338310c10bed5c88e41f63f
once the CI build there goes greenfull-toothbrush-75676
11/19/2021, 7:21 PMhappy-kitchen-89482
11/24/2021, 1:48 AM