Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Hack to work around ruby set concurrency bug #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aslakhellesoy
Copy link

Lately I have been getting errors like these when running fakes3:

[2014-05-14 22:28:36] INFO  WEBrick 1.3.1
[2014-05-14 22:28:36] INFO  ruby 2.0.0 (2013-11-22) [x86_64-linux]
[2014-05-14 22:28:36] WARN  TCPServer Error: Address already in use - bind(2)
[2014-05-14 22:28:36] INFO  WEBrick::HTTPServer#start: pid=5090 port=4567
[2014-05-14 22:36:17] ERROR NameError: method `old_init' not defined in SortedSet
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb:619:in `remove_method'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb:619:in `block in setup'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb:617:in `module_eval'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb:617:in `setup'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/set.rb:627:in `initialize'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/sorted_object_list.rb:20:in `new'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/sorted_object_list.rb:20:in `initialize'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/bucket.rb:13:in `new'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/bucket.rb:13:in `initialize'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/file_store.rb:58:in `new'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/file_store.rb:58:in `create_bucket'
    /home/ubuntu/.rvm/gems/ruby-2.0.0-p353/gems/fakes3-0.1.5/lib/fakes3/server.rb:134:in `do_PUT'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpservlet/abstract.rb:106:in `service'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
    /home/ubuntu/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
localhost - - [14/May/2014:22:36:17 UTC] "PUT /.cucumber/stepdefs.json HTTP/1.1" 200 0

Googling for the error I found socketry/timers#20 which suggests the bug is in ruby's SortedSet implementation. My pull request includes the same fix as that issue mentions.

@junjihashimoto
Copy link

junjihashimoto commented Jul 5, 2017

This problem still exists.

[2017-07-05 02:54:41] INFO  WEBrick 1.3.1
[2017-07-05 02:54:41] INFO  ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu]
[2017-07-05 02:54:41] INFO  WEBrick::HTTPServer#start: pid=526 port=8080
[2017-07-05 02:56:53] ERROR NameError: method `old_init' not defined in SortedSet
        /usr/lib/ruby/2.3.0/set.rb:686:in `remove_method'
        /usr/lib/ruby/2.3.0/set.rb:686:in `block in setup'
        /usr/lib/ruby/2.3.0/set.rb:684:in `module_eval'
        /usr/lib/ruby/2.3.0/set.rb:684:in `setup'
        /usr/lib/ruby/2.3.0/set.rb:694:in `initialize'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/sorted_object_list.rb:21:in `new'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/sorted_object_list.rb:21:in `initialize'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/bucket.rb:13:in `new'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/bucket.rb:13:in `initialize'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/file_store.rb:65:in `new'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/file_store.rb:65:in `create_bucket'
        /var/lib/gems/2.3.0/gems/fakes3-1.2.0/lib/fakes3/server.rb:193:in `do_PUT'
        /usr/lib/ruby/2.3.0/webrick/httpservlet/abstract.rb:107:in `service'
        /usr/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
        /usr/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
        /usr/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants