php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63275 Enhance register_shutdown_function docs about SIGTERM handling
Submitted: 2012-10-13 17:44 UTC Modified: 2012-11-12 22:41 UTC
From: eric at wepay dot com Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: eric at wepay dot com
New email:
PHP Version: OS:

 

 [2012-10-13 17:44 UTC] eric at wepay dot com
Description:
------------
There should be a note added to the documentation on register_shutdown_function 
that the callbacks will not be run if the process is killed via SIGTERM/SIGKILL, 
however they will run if SIGTERM is intercepted with pcntl_signal and the callback 
causes the script to exit cleanly; i.e. pcntl_signal(SIGTERM, function() { exit; 
});

Given the semantics of SIGTERM (request a clean shutdown of the process), it's 
unintuitive to not get the behavior of using "exit;", although I can see the 
reasoning for doing so.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-31 20:19 UTC] mail+php at requinix dot net
Did you know you can easily submit changes to the online documentation? Look for 
the [edit] link in the top-right corner of manual pages.

Here's a patch with your suggestions:
"register_shutdown_function: callbacks not executed if SIGTERMed/SIGKILLed (bug 
#63275)"
http://edit.php.net/?patchID=758&project=PHP
 [2012-11-12 22:34 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=328335
Log: Adding a note that shutdown functions won't be executed if the script gets a SIGTERM or SIGKILL, though you can pcntl_signal() for the TERM and exit;. (doc #63275)

--
Provided by anonymous #22227 (mail+php@requinix.net)
 [2012-11-12 22:41 UTC] salathe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Committed requinix's patch.
 [2012-11-12 22:41 UTC] salathe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: salathe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 10:01:28 2024 UTC