HomePhabricator

Avoid using "enqueue" mode for deferred updates in doPostOutputShutdown

Description

Avoid using "enqueue" mode for deferred updates in doPostOutputShutdown

Set appropriate headers and flush the output as needed to avoid blocking
the client on post-send updates for the stock apache2 server scenario.
Several cases have bits of header logic to avoid delay:

a) basic GET/POST requests that succeed (e.g. HTTP 2XX)
b) requests that fail with errors (e.g. HTTP 500)
c) If-Modified-Since requests (e.g. HTTP 304)
d) HEAD requests

This last two still block on deferred updates, so schedulePostSendJobs()
does not trigger on them as a form of mitigation. Slow deferred updates
should only trigger on POST anyway (inline and redirect responses are
OK), so this should not be much of a problem.

Deprecate triggerJobs() and implement post-send job runs as a deferred.
This makes it easy to check for the existence of post-send updates by
calling DeferredUpdates::pendingUpdatesCount() after the pre-send stage.
Also, avoid running jobs on requests that had exceptions. Relatedly,
remove $mode option from restInPeace() and doPostOutputShutdown()
Only one caller was using the non-default options.

Bug: T206283
Change-Id: I2dd2b71f1ced0f4ef8b16ff41ffb23bb5b4c7028

Details

Provenance
aaronAuthored on Sep 20 2019, 7:27 AM
Parents
rMW1791c928939f: Merge "resourceloader: Add $modules parameter to makeVersionQuery()"
Branches
Unknown
Tags
Unknown
ChangeId
I2dd2b71f1ced0f4ef8b16ff41ffb23bb5b4c7028