[php-src] Issue #9754: SaltStack (using Python subprocess) hangs when running php-fpm 8.1.11
| From: | bgdnlp | Date: | Fri, 14 Oct 2022 19:06:24 +0000 |
| Subject: | [php-src] Issue #9754: SaltStack (using Python subprocess) hangs when running php-fpm 8.1.11 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242600@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9754
Author: bgdnlp
### Description
I am cross-posting https://github.com/saltstack/salt/issues/62891
because I'm not sure what's happening, but it is related to PHP 8.1.11 and 8.0.24,
previous versions worked fine.
I tested on Ubuntu with Python 3.10 and FreeBSD with Python 3.9. Running
```
salt-call -l all cmd.run 'php-fpm8.1'
```
on Ubuntu or the equivalent on FreeBSD just hangs. It didn't use to do that.
To reproduce:
- start an Ubuntu instance
- install PHP 8.1:
-
apt-get install software-properties-common
- sudo apt-get install software-properties-common
- sudo add-apt-repository ppa:ondrej/php
- sudo apt-get update
- sudo apt install php8.1-fpm
- install SaltStack:
- sudo apt install python3-pip
- sudo pip3 install --upgrade salt
- sudo salt-minion <- run once. it will set up /etc, then it's not needed any
more
- run some random command with SaltStack, just to see how it should work:
- sudo salt-call -l all cmd.run 'ls'
- run php-fpm with SaltStack, this should just hang, although php-fpm does start:
- sudo salt-call -l all cmd.run 'php-fpm8.1'
SaltStack hangs when it gets to this line: https://github.com/saltstack/salt/blob/427718c5aed40b376785ebc4813f5ccd18e07272/salt/utils/timed_subprocess.py#L90
. At that point php-fpm is already running, Salt is just trying to
[interact](https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate) with
php-fpm.
I wasn't able to reproduce in Python directly.
### PHP Version
PHP 8.1.11 and PHP 8.0.24
### Operating System
FreeBSD 13.1 and Ubuntu 22.04