ldilley / rubircd

:speech_balloon: An IRC server written in Ruby
http://www.dilley.me/rubircd
GNU General Public License v3.0
22 stars 4 forks source link

RuntimeError: can't add a new key into hash during iteration #25

Closed ldilley closed 9 years ago

ldilley commented 9 years ago

The error below occurs when clients rapidly connect to the server. I suspect it is a thread timing/variable access issue.

RuntimeError: can't add a new key into hash during iteration
                []= at org/jruby/RubyHash.java:1002
        add_channel at /home/ldilley/projects/rubircd/trunk/user.rb:180
        synchronize at org/jruby/ext/thread/Mutex.java:149
        add_channel at /home/ldilley/projects/rubircd/trunk/user.rb:180
            on_join at (eval):130
               each at org/jruby/RubyArray.java:1617
            on_join at (eval):53
         initialize at (eval):24
               call at org/jruby/RubyProc.java:255
              parse at /home/ldilley/projects/rubircd/trunk/commands.rb:42
          main_loop at /home/ldilley/projects/rubircd/trunk/network.rb:373
               loop at org/jruby/RubyKernel.java:1489
          main_loop at /home/ldilley/projects/rubircd/trunk/network.rb:358
  plain_connections at /home/ldilley/projects/rubircd/trunk/network.rb:110

The exception is just caught and ignored for now with seemingly no ill effects (other than the rare case of the server saying you are not in the channel when issuing PART since the channel may have not been added to the User.channels hash.)