-
Notifications
You must be signed in to change notification settings - Fork 87
Server::UNIX code to bring in after UNIX sockets work fully under jRuby. #123
Conversation
One would also have to manually delete the socket file, like def shutdown
super
File.delete(@socket_path) if File.exists? (@socket_path)
end Dunno if it would be advisable to also do that during startup. |
I just duplicated the efforts of digitalextremist without realizing it to extend Reel::Server into a UNIXServer, @Asmod4n my thought is that you pretty much have to have something in front checking to see if the old process is running, then checking for and unlinking the file if not.. because you can't guarantee shutdown happened. It'd be better just to make people aware they have to clean up after themselves, probably, because there's no built in method to insure the right thing is going to happen for everyone.. and what happens with digitalextremist's / my code is just that... an error on startup that the socket is in use and a reminder to write better code to handle startup conditions. |
Hey @justindarby. @stouset wrote the UNIX server code, if I remember correctly. I just ported it to work in a post #121 world. We're still having problems with UNIX socket servers under jRuby though, so this piece was shelved to let #121 pass through and be released without UNIX socket server issues. Please check into the changes to |
Yeah, I'm using those changes, although I just brought Reel::Server into another class instead of Real::Server::UNIX. I withdraw my concern about shutdown, the following test case works as expected (shutdown doesn't fire) and I'm new to this code (and have already learned to not trust instincts developed by using conventional ruby):
|
@justindarby you forgot finalizer :shutdown in there |
Ah, yeah. Okay this is bad then. Throw finalizer :shutdown into the above code and we just unlinked a socket we don't own. |
Unrelated: @justindarby out of curiosity, are you using Rubinius, MRI, or somehow using jRuby? |
@digitalextremist Rubinius |
Continually unrelated, @digitalextremist I'm writing an app that either needs nginx sitting in front of it to handle baseline security policies or I have to rewrite equivalent functionality. So, Reel::Server::UNIX = good = keeps my app off the network. |
Based on celluloid#123, which hasn't been merged yet.
This looks great.... any idea when it might get merged? |
We're waiting for this to be usable under jRuby On March 4, 2015 10:50:40 AM PST, Tim Morgan [email protected] wrote:
|
…thout this being a problem.
Merged into |
This code is ready to follow-up to #121 once socketry/nio4r#37 is resolved.