~/talk

require() bombed my multi-threaded app!

Talkat RubyDay 2015 · on Friday, 2015-11-13· [ruby, concurrency]
name:J. Martin
links:none on file
slides:none on file

A Ruby app crashes under Sidekiq when autoloading mixes with manual requires causing double loads, constant redefinition warnings and hard-to-trace circular dependencies; Ruby 2 fixes autoload thread safety but ActiveSupport defaults to autoload vs require using Kernel.load which triggers repeats. Fixes: switch ActiveSupport to require, use eager_load_paths (not nested autoload paths), and adopt an isolated spec helper. Real results: three codebases drop test startup from 5–10 minutes to ~30 seconds; reproducing the original bug takes ~6 months of debugging.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 3:36Ruby code loading basics
  3. 15:27Active Support and autoloading
  4. 28:26Circular dependencies explained
  5. 31:58Rails autoload paths pitfalls
  6. 36:11Optimizing Rails test suites
  7. 39:01Best practices and takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.