Page MenuHomePhabricator

WaitConditionLoop should fail when condition is aborted
Closed, ResolvedPublicBUG REPORT

Description

WaitConditionLoop has a bug, repro:

>>> (new Wikimedia\WaitConditionLoop(function () { 
       return Wikimedia\WaitConditionLoop::CONDITION_ABORTED; 
    }, 0))->invoke() === Wikimedia\WaitConditionLoop::CONDITION_REACHED
=> true

In wmf.14 this bug allowed the MessageCache to fail, but continue anyways. The MessageCache would disable itself and fallback to LocalisationCache which reads from CDB files.

In wmf.15 the intermediary lock/unlock in BagOStuff was refactored. This refactor avoided the bug above by following a slightly different path to deciding if the lock was actually locked. With the lock correctly reporting failure in wmf.15 the [CirrusSearch] maintenance scripts are no longer running.

Event Timeline

Change 713337 had a related patch set uploaded (by Krinkle; author: Ebernhardson):

[mediawiki/libs/WaitConditionLoop@master] Correctly report failure with no timeout

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

Krinkle triaged this task as Medium priority.

Change 713337 merged by jenkins-bot:

[mediawiki/libs/WaitConditionLoop@master] Correctly report failure with no timeout

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

I'll tag a release and submit the pull throughs for core vendor.

Change 714408 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/libs/WaitConditionLoop@master] Tag 2.0.2

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

Change 714408 merged by jenkins-bot:

[mediawiki/libs/WaitConditionLoop@master] Tag 2.0.2

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

Change 714419 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] Update wikimedia/wait-condition-loop from 2.0.1 to 2.0.2

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

Change 714429 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/vendor@master] Update wikimedia/wait-condition-loop from 2.0.1 to 2.0.2

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

Change 714429 merged by jenkins-bot:

[mediawiki/vendor@master] Update wikimedia/wait-condition-loop from 2.0.1 to 2.0.2

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

Change 714419 merged by jenkins-bot:

[mediawiki/core@master] Update wikimedia/wait-condition-loop from 2.0.1 to 2.0.2

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

Krinkle reassigned this task from Krinkle to EBernhardson.