rails: Missing zeitwerk synchronization in rails 7.0.2.2 and ruby 3.1.0
Originally reported at https://github.com/fxn/zeitwerk/issues/207
It seems that rails is not synchronizing zeitwerk when it autoload classes, causing a RuntimeError
: can't add a new key into hash during iteration
. The constant loading is aborted and only restarting the rails server causes it to retry loading the constant.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 28 (20 by maintainers)
Commits related to this issue
- Undo concurrent autoload while reloading detection The motivation for this feature was https://github.com/rails/rails/issues/44264 because the initial hypoyhesis was unsynchronized reload. Howeve... — committed to fxn/zeitwerk by fxn 2 years ago
- Undo concurrent autoload while reloading detection The motivation for this feature was https://github.com/rails/rails/issues/44264 because the initial hypoyhesis was unsynchronized reload. Howeve... — committed to connorchris831/zeitwerk by connorchris831 2 years ago
- Undo concurrent autoload while reloading detection The motivation for this feature was https://github.com/rails/rails/issues/44264 because the initial hypoyhesis was unsynchronized reload. Howeve... — committed to tigran25/zeitwerk by tigran25 2 years ago
Setting the number of puma threads to only one, I can’t reproduce the issue.