[ 
https://issues.apache.org/jira/browse/THRIFT-1543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16753105#comment-16753105
 ] 

James E. King III commented on THRIFT-1543:
-------------------------------------------

Based on the documentation:

http://php.net/manual/en/function.pcntl-waitpid.php

Specifically the return value:

Return Values ΒΆ
pcntl_waitpid() returns the process ID of the child which exited, -1 on error 
or zero if WNOHANG was used and no child was available

The code as it is today, looking for a value greater than zero, is correct.  A 
negative value indicates an error occurred.  Now perhaps we should be 
attempting some sort of action on the error case, however the documentation 
does not state what error codes can occur.  The patch is not correct and would 
actually lead to far more resource leaks.

> Sockets created by the PHP TForkingServer are not freed
> -------------------------------------------------------
>
>                 Key: THRIFT-1543
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1543
>             Project: Thrift
>          Issue Type: Bug
>          Components: PHP - Library
>    Affects Versions: 0.8
>            Reporter: D. Edler
>            Assignee: James E. King III
>            Priority: Major
>              Labels: patch, php
>         Attachments: ForkingServerPatch.txt
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> The generated TForkingServer has a bug. 
> The pointer to the transport object of created children are not freed. so the 
> sockets created after accept() stay alive until the os kills them.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to