Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99304587
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
Thu, Jan 23, 07:08
Size
652 B
Mime Type
text/x-php
Expires
Sat, Jan 25, 07:08 (1 d, 17 h)
Engine
blob
Format
Raw Data
Handle
23772660
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