Add support for using RequestStore within Sidekiq tasks via SIDEKIQ_REQUEST_STORE env variable
What does this MR do?
This MR adds a Sidekiq middleware that uses RequestStore to speed up Banzai reference lookup.
Are there points in the code the reviewer needs to double check?
There may be some additional memory usage from using RequestStore.
Why was this MR needed?
PostReceive tasks can run slow if large number of references have to be extracted from commits. RequestStore is already used as cache for Banzai references in the Rails app; this helps speed up the Sidekiq tasks as well.
With a local PostgreSQL DB with 697 commits to process, this sped up the PostReceive
task from ~32 s to 28 s. The savings will be larger for a PostgreSQL DB on a different machine.
What are the relevant issue numbers?
Relevant Omnibus change: omnibus-gitlab!854 (closed)
Does this MR meet the acceptance criteria?
-
CHANGELOG entry added -
Documentation created/updated - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the style guides -
Branch has no merge conflicts with master
(if you do - rebase it please) -
Squashed related commits together