shiftcommerce / flex-ruby-gem

💎 The Ruby library used to integrate with the Shift Platform API
MIT License
2 stars 0 forks source link

Instead of autoloading classes, load them by require #195

Open praweb opened 4 years ago

praweb commented 4 years ago

Background story

On 23rd June, Matalan site has seen a through put raised to 7.5k rpm during which we started seeing Threads deadlock issues on site. We did see this amount of throughput before, but we never seen this issue.

On a bit of investigation we have found that autoloading the classes in the ruby gem can be a reason for this. Issue reported here: https://github.com/rails/rails/issues/24028 Repo where the issue can be replicated: https://github.com/TikiTDO/rails_issue_24028

So this ticket is make that change, to start requiring the classes, instead of autoload.

UserStory

As a developer, I want to avoid the Threads deadlocks situation So that site would work as expected

Acceptance Criteria

  1. Change the autoload of classes to load via require
  2. Ensure all the specs are still passing.