HomePhabricator

When search indexers contend for a lock, just yield

Description

When search indexers contend for a lock, just yield

Summary:
Depends on D19503. Ref T13151. See PHI719. If you have something like a script which updates an object in a loop, we can end up queueing many search reindex tasks.

These tasks may reasonably contend for the lock, especially if the object is larger (lots of text and/or lots of comments) and indexing takes a few seconds.

This isn't concerning, and the indexers should converge to good behavior quickly once the updates stop.

Today, they'll spew a bunch of serious-looking lock exceptions into the log. Instead, just yield so it's more clear that there's (normally) no cause for concern here.

Test Plan: Ran bin/search index Txxx --force on a large object in multiple windows with a 0 second lock, saw an explicit yield instead of a lock exception.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13151

Differential Revision: https://secure.phabricator.com/D19504

Details

Provenance
epriestleyAuthored on Jun 22 2018, 5:01 PM
epriestleyPushed on Jun 23 2018, 12:41 AM
Reviewer
amckinley
Differential Revision
D19504: When search indexers contend for a lock, just yield
Parents
rP14e911a0d8c0: Index only the first 1,000 comments on any object
Branches
Unknown
Tags
Unknown
Tasks
T13151: Plans: 2018 Week 23 - Week 30 Bonus Content
Build Status
Buildable 20447
Build 27772: Run Core Tests