Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player server doesn't shutdown drb on SIGINT #8

Open
ghost opened this issue Feb 9, 2014 · 4 comments
Open

Player server doesn't shutdown drb on SIGINT #8

ghost opened this issue Feb 9, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Feb 9, 2014

Been running & interrupting the player server while testing my player. ctrl+c doesn't always stop the drb instance, causing Address already in use exceptions.

/Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:879:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 4433 (Errno::EADDRINUSE)
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:879:in `open'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:879:in `open_server'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:764:in `block in open_server'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:762:in `each'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:762:in `open_server'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:1373:in `initialize'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:1664:in `new'
    from /Users/bm5k/.rvm/rubies/ruby-2.1.0-p0/lib/ruby/2.1.0/drb/drb.rb:1664:in `start_service'
    from /Users/bm5k/projects/bm5k/battleship/bin/player_server.rb:32:in `initialize'
    from /Users/bm5k/projects/bm5k/battleship/bin/player_server.rb:56:in `new'
    from /Users/bm5k/projects/bm5k/battleship/bin/player_server.rb:56:in `block in <main>'
    from /Users/bm5k/projects/bm5k/battleship/bin/player_server.rb:59:in `call'
    from /Users/bm5k/projects/bm5k/battleship/bin/player_server.rb:59:in `<main>'
@threedaymonk
Copy link
Owner

I can't reproduce this (on Linux).

Do the player server processes receive the stop command?

def stop(secret)

@ghost
Copy link
Author

ghost commented Feb 10, 2014

@threedaymonk I'm only experiencing this problem intermittently. OS X 10.9.1.

I will add some debugging to the stop method to see if I can narrow it down further.

@mikespangler
Copy link

I'm experiencing this issue consistently in OSX 10.9.1.

/Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:879:in `initialize': Address already in use - bind(2) for "0.0.0.0" port 4433 (Errno::EADDRINUSE)
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:879:in `open'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:879:in `open_server'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:764:in `block in open_server'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:762:in `each'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:762:in `open_server'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:1373:in `initialize'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:1664:in `new'
    from /Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:1664:in `start_service'
    from /Users/mikespangler/code/battleship/bin/player_server.rb:33:in `initialize'
    from /Users/mikespangler/code/battleship/bin/player_server.rb:57:in `new'
    from /Users/mikespangler/code/battleship/bin/player_server.rb:57:in `block in <main>'
    from /Users/mikespangler/code/battleship/bin/player_server.rb:60:in `call'
    from /Users/mikespangler/code/battleship/bin/player_server.rb:60:in `<main>'
/Users/mikespangler/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/drb/drb.rb:1117:in `method_missing': Battleship::ValidatingServer:: (DRb::DRbUnknownError)
    from bin/play.rb:27:in `kill'
    from bin/play.rb:89:in `each'
    from bin/play.rb:89:in `ensure in <main>'
    from bin/play.rb:89:in `<main>'

@threedaymonk
Copy link
Owner

@mikespangler Well, if you can reliably reproduce it, that's a start. Please check whether the player processes are receiving stop (see my earlier comment).

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

No branches or pull requests

2 participants