Page MenuHomePhabricator

ParserOutput::getTimes and Profiler::getTime return wrong results in HHVM
Closed, ResolvedPublic

Description

The PHP function getrusage() invokes the system call of the same name with RUSAGE_SELF, which requests usage information for the calling process. Callers of getrusage() in MediaWiki assume the PHP process is not shared by multiple requests, and that the resource usage measured by RUSAGE_SELF is thus attributable to the current request. These assumptions are false under HHVM.

Unfortunately, the getrusage() PHP function currently does not allow callers to request RUSAGE_THREAD info. I submitted a pull-request to HHVM to add this feature: https://github.com/facebook/hhvm/pull/3632. We need to update ParserOutput::getTimes and Profiler::getTime once it is merged.

The other caller of getrusage() is a benchmarkParse.php. It doesn't need to be fixed, because it's a standalone maintenance script.


Version: unspecified
Severity: normal
URL: https://github.com/facebook/hhvm/pull/3632

Details

Reference
bz70227

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:40 AM
bzimport set Reference to bz70227.
bzimport added a subscriber: Unknown Object (MLST).

gerritadmin wrote:

Change 158550 had a related patch set uploaded by Ori.livneh:
Add wfGetRusage(), wrapping getrusage(2) syscall

https://gerrit.wikimedia.org/r/158550

gerritadmin wrote:

Change 158550 merged by jenkins-bot:
Under HHVM, measure resources for the thread, not calling process

https://gerrit.wikimedia.org/r/158550

gerritadmin wrote:

Change 159703 had a related patch set uploaded by Ori.livneh:
Under HHVM, measure resources for the thread, not calling process

https://gerrit.wikimedia.org/r/159703

gerritadmin wrote:

Change 159704 had a related patch set uploaded by Ori.livneh:
Under HHVM, measure resources for the thread, not calling process

https://gerrit.wikimedia.org/r/159704

gerritadmin wrote:

Change 159704 merged by jenkins-bot:
Under HHVM, measure resources for the thread, not calling process

https://gerrit.wikimedia.org/r/159704

gerritadmin wrote:

Change 159703 merged by jenkins-bot:
Under HHVM, measure resources for the thread, not calling process

https://gerrit.wikimedia.org/r/159703