<#18210 `experimental_shell_command` in a docker e...
# github-notifications
q
#18210 `experimental_shell_command` in a docker environment that timeouts doesn't kill process Issue created by huonw 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
Copy code
git clone <https://gist.github.com/huonw/d2dea90e86c2c4b16ce5d8ff21cebcdb>
cd d2dea90e86c2c4b16ce5d8ff21cebcdb
./run.sh
Copy code
# 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",
)
Copy code
#!/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 pantsbuild/pants