Work around hhvm bug in redis job queue
authorNik Everett <neverett@wikimedia.org>
Mon, 7 Jul 2014 20:17:39 +0000 (16:17 -0400)
committerNik Everett <neverett@wikimedia.org>
Mon, 7 Jul 2014 22:12:12 +0000 (18:12 -0400)
The hhvm redis client returns false instead of null.  This caused
JobQueueRedis to get stuck in an infinite loop.  This works around the
difference by catching null as a signal for no more jobs.

It can be reverted when https://github.com/facebook/hhvm/pull/3127/ is
in all versions of hhvm we expect to run MediaWiki.

Bug: 67622
Change-Id: I9bbad42f36a80635097b8e0140b48b6492b2f0f5

includes/jobqueue/JobQueueRedis.php

index 39fccdd..088f447 100644 (file)
@@ -313,7 +313,7 @@ LUA;
                                } else {
                                        $blob = $this->popAndDeleteBlob( $conn );
                                }
-                               if ( $blob === false ) {
+                               if ( !is_string( $blob ) ) {
                                        break; // no jobs; nothing to do
                                }