Open
Description
Describe the bug
If an experimental_shell_command
exceeds its timeout (potentially any command with a timeout?) while running in a docker environment, the underlying process is left still running. This may lead to resource exhaustion.
Reproducer: https://gist.github.com/huonw/d2dea90e86c2c4b16ce5d8ff21cebcdb
git clone https://gist.github.com/huonw/d2dea90e86c2c4b16ce5d8ff21cebcdb
cd d2dea90e86c2c4b16ce5d8ff21cebcdb
./run.sh
# BUILD
docker_environment(
name="docker",
image="python:3.9.10-bullseye",
)
experimental_shell_command(
name="esc",
command="sleep 100000",
tools=["sleep"],
timeout=1,
environment="docker",
)
#!/bin/bash
pkill -f pantsd
docker stop $(docker ps -aq)
pants version
#> 2.15.0rc4
pants export-codegen :esc
#> ... Exceeded timeout of 1.0 seconds when executing local process: Running experimental_shell_command //:esc
docker top $(docker ps -q)
#> ...
#> root ... sleep 100000
Pants version
2.15.0rc4
OS
macOS
Additional info
https://gist.github.com/huonw/d2dea90e86c2c4b16ce5d8ff21cebcdb
Activity