Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22415444
PhutilBacktraceSignalHandler.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
652 B
Referenced Files
None
Subscribers
None
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
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 01:26 (14 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1216673
Default Alt Text
PhutilBacktraceSignalHandler.php (652 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline