Skip to content

Add support for using RequestStore within Sidekiq tasks via SIDEKIQ_REQUEST_STORE env variable

Stan Hu requested to merge add-sidekiq-request-store into master

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?

#18663 (moved)

Relevant Omnibus change: omnibus-gitlab!854 (closed)

Does this MR meet the acceptance criteria?

Merge request reports