Bug #75749 [Com]: pcntl_fork does not duplicate stream_sockets
| From: | fmargaine@php.net | Date: | Sat, 30 Dec 2017 23:13:39 +0000 |
| Subject: | Bug #75749 [Com]: pcntl_fork does not duplicate stream_sockets | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-213334@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75749&edit=1
ID: 75749
Comment by: fmargaine@php.net
Reported by: michaela dot merz at roillofone dot com
Summary: pcntl_fork does not duplicate stream_sockets
Status: Open
Type: Bug
Package: Streams related
Operating System: Linux
PHP Version: 7.0.26
Block user comment: N
Private report: N
New Comment:
Hi,
Could you provide a reproducible test case?
Previous Comments:
------------------------------------------------------------------------
[2017-12-30 22:46:23] michaela dot merz at roillofone dot com
Description:
------------
Process "A" has a number of open network stream sockets and watches those sockets via
stream_select. Some are in "accepted" state (the connection has been established). Process
"A" maintains static connections (think IRC) itself while http-connections are passed to
pcntl_fork() after being accepted.
Let's say parent process "A" has accepted #23 and #24 . #24 is handled in a daughter
process "B". If "B" exits .. or fclose(#23) is called by "B" , the
resource #23 in "A" is also terminated. According to the (C-) norm. file descriptors
should be copied and closing them in a fork()ed process should not influence the master process.
Same should be valid for stream resources.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75749&edit=1