1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-25 04:59:06 +01:00
phorge-phorge/src/infrastructure
epriestley 0e4d62847c (stable) When acquiring a GlobalLock, put good connections that just got unlucky back in the pool
Summary:
See PHI1794, which describes a connection exhaustion issue with a large number of webhook tasks in queue.

The "GlobalLock" mechanism manages a separate connection pool from the main pool, and webhook workers immediately try to grab a webhook lock with a 0-second wait when they start. So far, this is fine.

Prior to this change, good connections which fail to acqiure a lock are discarded. This can lead to connection exhaustion as the worker rapidly cycles through lock attempts: the connections will remain open for at least 60 seconds (since D16389) in an effort to avoid outbound port exhaustion, but they're effectively orphaned because they aren't part of the main pool and aren't part of the lock pool. We're basically leaking a connection every time we fail to lock.

Failing to lock doesn't mean we need to discard the connection: it's a completely suitable connection for reuse. Instead of dropping it on the floor, put it into the lock pool.

Test Plan:
  - Used "bin/webhook call ... --count 10000 --background" to queue a large number of webhook calls against a slow ("sleep(15);") webhook.
  - Used "bin/phd launch 32 taskmaster" to start taskmasters.
  - Observed MySQL connection behavior:
    - Before change: 2048 configured connections immediately exhausted.
    - After change: connections stable at ~160ish.
  - Ran queue for a while, saw expected single-threaded calls to webhook.

Differential Revision: https://secure.phabricator.com/D21369
2020-06-25 18:06:44 -07:00
..
cache (stable) Use "@" to silence "GC list" warnings from "apc_store()" and "apcu_store()" 2020-04-28 04:13:57 -07:00
cluster Make "bin/storage destroy" target individual hosts in database cluster mode 2019-09-04 10:11:08 -07:00
contentsource Redesign Config Application 2016-08-29 15:49:49 -07:00
customfield Respect "disabled" custom field status granted by "subtype" configuration in form validation 2019-08-21 18:03:20 -07:00
daemon (stable) Treat PHP7 "Throwable" exceptions like other unhandled "Exception" cases in the worker queue 2020-05-19 10:42:10 -07:00
diff Use the changeset parse cache to cache suggestion changesets 2020-05-20 14:29:27 -07:00
edges Fix an issue where loading a mangled project graph could fail too abruptly 2020-02-03 08:54:04 -08:00
editor Restore editor behavior to Diffusion and support "\" shortcut 2020-04-19 09:41:37 -07:00
env (stable) Promote 2019 Week 36 2019-09-08 17:02:58 -07:00
events Remove "PhabricatorEventType::TYPE_DIFFUSION_LOOKUPUSER" event 2019-11-19 09:38:03 -08:00
export Export "date" and "remarkup" custom fields to Excel + "zip" extension check 2019-07-18 09:59:20 -07:00
graph Add a "Subtype" tag to the task graph view in Maniphest 2019-09-27 10:58:55 -07:00
internationalization Render proper "Show Context" links in DocumentEngine diffs, not just bullets 2020-05-12 16:09:22 -07:00
javelin When the profiler is active, keep it active if the user submits forms 2017-02-23 11:15:40 -08:00
lint/linter Linter fixes 2015-12-03 07:44:23 +11:00
lipsum Continue moving classes with no callers in libphutil or Arcanist to Phabricator 2020-02-12 13:14:04 -08:00
log Proxy the "git upload-pack" wire protocol 2019-04-18 04:57:51 -07:00
management Add additional flags to "bin/repository rebuild-identities" to improve flexibility 2019-11-19 09:39:48 -08:00
markup (stable) Fix an issue where the "%%%" parser could match too many lines in unterminated blocks 2020-05-03 09:26:10 -07:00
parser Continue moving classes with no callers in libphutil or Arcanist to Phabricator 2020-02-12 13:14:04 -08:00
query Modularize Ferret fulltext functions 2020-04-16 13:41:13 -07:00
ssh Generate a random unique "Request ID" for SSH requests so processes can coordinate better 2018-03-22 13:44:30 -07:00
status Give Drydock Leases more modern status treatment 2018-02-13 13:15:57 -08:00
storage Improve use of keys when iterating over commits in "bin/audit delete" and "bin/repository rebuild-identities" 2019-11-19 10:18:55 -08:00
syntax Pass the new default syntax highlighting map to the remarkup engine 2016-05-05 02:51:19 -07:00
testing When running unit tests, ignore any custom task fields 2017-04-02 09:36:17 -07:00
time Render timezone names more readably, with spaces rather than underscores ("America/Los Angeles", not "America/Los_Angeles"). 2019-05-30 15:03:11 -07:00
util (stable) When acquiring a GlobalLock, put good connections that just got unlucky back in the pool 2020-06-25 18:06:44 -07:00
PhabricatorEditor.php Mark some strings for translation 2015-06-09 23:06:52 +10:00