diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-08-29 15:26:12 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-29 15:26:12 +0900 |
commit | 0a1e353c43e3e2195baaac15dde9422579ab7ea6 (patch) | |
tree | eabf883a7adefe9f2d40986399fa7d9f6ca26250 /actionpack/lib | |
parent | d3e7dc6f16d68492a159d874f72a3a229a62f844 (diff) | |
parent | fe4753fac87317180c1dadfa07112bbe9f72aaf5 (diff) | |
download | rails-0a1e353c43e3e2195baaac15dde9422579ab7ea6.tar.gz rails-0a1e353c43e3e2195baaac15dde9422579ab7ea6.tar.bz2 rails-0a1e353c43e3e2195baaac15dde9422579ab7ea6.zip |
Merge pull request #30433 from y-yagi/fix_cant_modify_forzen_string_error_in_debug_locks
Fix `can't modify frozen String` error in `DebugLocks`
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/debug_locks.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/debug_locks.rb b/actionpack/lib/action_dispatch/middleware/debug_locks.rb index c61a941010..03760438f7 100644 --- a/actionpack/lib/action_dispatch/middleware/debug_locks.rb +++ b/actionpack/lib/action_dispatch/middleware/debug_locks.rb @@ -43,7 +43,7 @@ module ActionDispatch private def render_details(req) - threads = ActiveSupport::Dependencies.interlock.raw_state do |threads| + threads = ActiveSupport::Dependencies.interlock.raw_state do |raw_threads| # The Interlock itself comes to a complete halt as long as this block # is executing. That gives us a more consistent picture of everything, # but creates a pretty strong Observer Effect. @@ -53,29 +53,29 @@ module ActionDispatch # strictly diagnostic tool (to be used when something has gone wrong), # and not for any sort of general monitoring. - threads.each.with_index do |(thread, info), idx| + raw_threads.each.with_index do |(thread, info), idx| info[:index] = idx info[:backtrace] = thread.backtrace end - threads + raw_threads end str = threads.map do |thread, info| if info[:exclusive] - lock_state = "Exclusive" + lock_state = "Exclusive".dup elsif info[:sharing] > 0 - lock_state = "Sharing" + lock_state = "Sharing".dup lock_state << " x#{info[:sharing]}" if info[:sharing] > 1 else - lock_state = "No lock" + lock_state = "No lock".dup end if info[:waiting] lock_state << " (yielded share)" end - msg = "Thread #{info[:index]} [0x#{thread.__id__.to_s(16)} #{thread.status || 'dead'}] #{lock_state}\n" + msg = "Thread #{info[:index]} [0x#{thread.__id__.to_s(16)} #{thread.status || 'dead'}] #{lock_state}\n".dup if info[:sleeper] msg << " Waiting in #{info[:sleeper]}" |