jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/390526 )

Change subject: Add warning and documentation comment to HHVMRequestInit.php
......................................................................


Add warning and documentation comment to HHVMRequestInit.php

Ref T180183.

Change-Id: Idc5f71eef482d84918fb4daf568fc99aa42bd266
---
M wmf-config/HHVMRequestInit.php
1 file changed, 24 insertions(+), 4 deletions(-)

Approvals:
  Krinkle: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/HHVMRequestInit.php b/wmf-config/HHVMRequestInit.php
index 9128263..1919a72 100644
--- a/wmf-config/HHVMRequestInit.php
+++ b/wmf-config/HHVMRequestInit.php
@@ -1,10 +1,30 @@
 <?php
 /**
- * Initialization code for HHVM.
+ * Initialization code for HHVM worker threads.
  *
- * We configure HHVM to run this file at the very beginning of each
- * request by setting the path to this file as the value of HHVM's
- * `hhvm.server.request_init_document` setting.
+ * WARNING: This result of running this file is *cached* by HHVM.
+ *
+ * HHVM is configured to run this file at the beginning of each worker
+ * thread through the `hhvm.server.request_init_document` setting.
+ *
+ * The result of executing this PHP file is cached by taking a snapshot
+ * of the VM state. At the start of each request, the state is restored
+ * restored to that of the snapshot. That means, this file CAN expose
+ * variables, functions and other state to the "real" run-time for
+ * web requests, however, there are two important caveats:
+ *
+ * 1) This file itself does not have access to request-specific
+ *    data such as $_GET, $_POST, $_COOKIE and (most of) $_SERVER,
+ *    because it runs before that state is created and does not
+ *    re-run for each request.
+ * 2) This file is efffectively cached. Unlike other PHP files
+ *    executed by HHVM/PHP, this file is not ensured to be re-run
+ *    when it changes on-disk. To be safe, one should restart HHVM
+ *    between deploying a change to this file and depending on the
+ *    state elsewhere. Or (better yet), never depend on the state
+ *    created by this file.
+ *
+ * @see 
https://github.com/facebook/hhvm/blob/HHVM-3.22.0/hphp/doc/server.documents
  */
 if ( !defined( 'HHVM_VERSION' ) ) {
        return;

-- 
To view, visit https://gerrit.wikimedia.org/r/390526
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idc5f71eef482d84918fb4daf568fc99aa42bd266
Gerrit-PatchSet: 2
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Urbanecm <martin.urba...@wikimedia.cz>
Gerrit-Reviewer: Zoranzoki21 <zorandori4...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to