* Add appraisal
* Test CLI run (write pid, system boot, print banner)
* Cleanup test helper
* Set REDIS_URL to use non-default host in test env
* Move mintiest-focus to test bundle group
This reverts commit a27d692656.
The reason for reverting is that this middleware has no effect. In Rails
5.0+, Sidekiq runs its jobs using the Rails reloader/executor API[1].
In Rails 5.0+, however, the ActiveRecord query cache registers its own
hooks with the executor[2], and these hooks automatically enable the
query cache for the duration of any work the executor performs[3].
As a result, the query cache is already on by default for any Sidekiq
jobs run in Rails 5.0+, so it's not necessary to separately enable it in
a middleware.
[1] eca6acc0ce/lib/sidekiq/rails.rb (L33-L37)
[2] f8c00c1300/activerecord/lib/active_record/railtie.rb (L159-L163)
[3] f8c00c1300/activerecord/lib/active_record/query_cache.rb (L26-L41)
I don’t believe we need the Psych patch anymore because Sidekiq 5 guarantees that jobs are executed within Rails::Executor so classes should load as normal. This was not the case back in early 4.2.x, 4.2.0, 4.2.1, etc.
* Rework job processing in light of Rails 5's Reloader, see #3221
* Ignore built gems
* Documentation, testing
* Add fallback for 'retry' value server-side, fixes#3234
* Fix job hash reporting in stats
* cleanup
* Add job for AJ testing
* Push jobs with invalid JSON immediately to Dead set, fixes#3296
* Break retry logic into global and local parts, fixes#3306
* fix heisentest
We have to release the current thread's Active Record connection after
performing each job, in case another thread is waiting to use it.
On Rails 4 and earlier, this is handled with middleware. On Rails 5 in
development mode, the reloader does it by delegating to the executor.
However on Rails 5 in production mode, we're not adding the middleware
or enabling the reloader, so connections will never be released.
We can call the executor directly to have it release the connection for
us in this case. By calling it inside the middleware stack, the job will
be retried if the executor raises, avoiding the problem with lost jobs
that led to the reloader being disabled in production.
* Prevent AR middleware and reloader clash
The ActiveRecord middleware releases any current ActiveRecord
connections before the reloader has a chance to clear their query
caches.
We can just remove this middleware because the reloader takes care of
clearing active connections, too.
* Make sure folks haven't added the middleware manually
* Fix the conditional
* Mention that the reloader also clears connections
* Move it all back into a single method
* Typos
* Pull all rails setup into railtie
* Set the middleware even earlier
Also clarify exactly when these hooks are run.
* Only check ActiveRecord reloader/middleware sanity at boot
Checking if the constant is define and including the extensions directly
in the base class will for the class to be loaded. This may cause these
components to be loaded before the time and be missconfigured if the
sidekiq railtie is loaded before the components railtie.
It is unlikely to happen but is better be safe.
Replaced with `__send__` from std lib
* `send` can now be overridden to be more semantically meaningful
* `message.send(user_id)` as opposed to `message.send_message(user_id)`
* `__send__` makes it clear that the reflective version is intended
Workers are the user's classes, the threads are now called processors. Add secret sauce to make Rails config much easier. Use a railtie to auto-add app/workers to the autoload path.