Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101637343
PhutilBacktraceSignalHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 12, 08:02
Size
652 B
Mime Type
text/x-php
Expires
Fri, Feb 14, 08:02 (2 d)
Engine
blob
Format
Raw Data
Handle
24203144
Attached To
rPHU libphutil
PhutilBacktraceSignalHandler.php
View Options
<?php
/**
* Signal handler for SIGHUP which prints the current backtrace out to a
* file. This is particularly helpful in debugging hung/spinning processes.
*/
final
class
PhutilBacktraceSignalHandler
extends
PhutilSignalHandler
{
public
function
canHandleSignal
(
PhutilSignalRouter
$router
,
$signo
)
{
return
(
$signo
===
SIGHUP
);
}
public
function
handleSignal
(
PhutilSignalRouter
$router
,
$signo
)
{
$e
=
new
Exception
();
$pid
=
getmypid
();
// Some Phabricator daemons may not be attached to a terminal.
Filesystem
::
writeFile
(
sys_get_temp_dir
().
'/phabricator_backtrace_'
.
$pid
,
$e
->
getTraceAsString
());
}
}
Event Timeline
Log In to Comment