Commit e12aa98
committed
Skip Object.const_get entirely to prevent autoloader deadlocks
const_defined? returns true for constants registered via
Module#autoload (as Zeitwerk does), so guarding const_get with
const_defined? still triggers autoloading and deadlocks.
Instead, skip string-to-class resolution entirely:
- Registry.find_by_class: only walk ancestors when name is already
a Class object; return nil for strings. Use Registry.add_alias to
register subclasses that should inherit a parent's throttle.
- Throttled.requeue_throttled: pass the class name string directly
to Registry.get instead of resolving it with const_get.
Fixes #213
Made-with: Cursor1 parent 5f59fa8 commit e12aa98
2 files changed
Lines changed: 9 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | 103 | | |
111 | | - | |
| 104 | + | |
112 | 105 | | |
113 | 106 | | |
114 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
104 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | | - | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | | - | |
| 114 | + | |
113 | 115 | | |
114 | 116 | | |
115 | 117 | | |
116 | | - | |
117 | | - | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments