celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
595 stars 87 forks source link

Server#finalize fails if the socket was unable to be created #39

Closed halorgium closed 11 years ago

halorgium commented 11 years ago

We should only close if possible.

Errno::EACCES: Permission denied - bind(2)
    /Users/tim/Projects/celluloid-io/lib/celluloid/io/tcp_server.rb:11:in `initialize'
    /Users/tim/Projects/celluloid-io/lib/celluloid/io/tcp_server.rb:11:in `new'
    /Users/tim/Projects/celluloid-io/lib/celluloid/io/tcp_server.rb:11:in `initialize'
    /Users/tim/Projects/reel/lib/reel/server.rb:13:in `new'
    /Users/tim/Projects/reel/lib/reel/server.rb:13:in `initialize'

NoMethodError: undefined method `close' for nil:NilClass
    /Users/tim/Projects/reel/lib/reel/server.rb:20:in `finalize'
    /Users/tim/Projects/celluloid/lib/celluloid/actor.rb:386:in `block in run_finalizer'
    /Users/tim/Projects/celluloid/lib/celluloid/tasks/task_fiber.rb:28:in `block in initialize'
halorgium commented 11 years ago

Found a few other cases too.

coveralls commented 11 years ago

Coverage remained the same when pulling c28fb1a6ae731b2b5d5d00d2080eda290dc8779f on halorgium:cleanup-guards into ae610ec910569482f2d9d038caa9a8a74dd3b6ed on celluloid:master.

View Details

coveralls commented 11 years ago

Coverage remained the same when pulling c28fb1a6ae731b2b5d5d00d2080eda290dc8779f on halorgium:cleanup-guards into ae610ec910569482f2d9d038caa9a8a74dd3b6ed on celluloid:master.

View Details

coveralls commented 11 years ago

Coverage remained the same when pulling c28fb1a6ae731b2b5d5d00d2080eda290dc8779f on halorgium:cleanup-guards into ae610ec910569482f2d9d038caa9a8a74dd3b6ed on celluloid:master.

View Details