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

Sidekiq::ProcessSet#quiet! causes JRuby process exit #2063

Closed
substars opened this issue Nov 26, 2014 · 5 comments
Closed

Sidekiq::ProcessSet#quiet! causes JRuby process exit #2063

substars opened this issue Nov 26, 2014 · 5 comments

Comments

@substars
Copy link
Contributor

Using latest Sidekiq (Pro) on JRuby 1.7.16, quieting via the API causes the process to exit with a terse message and nothing in the logs:

User defined signal 1: 30

I thought the API was designed for cases like JRuby where USR1 won't work, but the Sidekiq heartbeat method looks like it pops a signal out of Redis and then does a Process.kill [1]. That's the same IPC I'd expect not to work on JRuby, no?

Or maybe I'm missing something? Please advise, thanks!

[1] https://github.com/mperham/sidekiq/blob/master/lib/sidekiq/manager.rb#L162

@mperham
Copy link
Collaborator

mperham commented Nov 26, 2014

I don't think you're missing anything. We probably shouldn't be using signals to implement that.

@substars
Copy link
Contributor Author

Cool, maybe I'll take a crack at putting together a PR this weekend.

@mperham mperham added the bug label Dec 10, 2014
@mperham
Copy link
Collaborator

mperham commented Dec 10, 2014

Please use -Xrs when running on JRuby if you need to use USR1.

http://jira.codehaus.org/browse/JRUBY-2608

@mperham mperham closed this as completed Dec 10, 2014
@mperham
Copy link
Collaborator

mperham commented Dec 10, 2014

Oy, -Xrs doesn't make USR1 available according to http://www.oracle.com/technetwork/java/javase/signals-139944.html#gbzbl

@mperham mperham reopened this Dec 10, 2014
@substars
Copy link
Contributor Author

I started on this and the code got really ugly really fast so I wanted to try an alternative approach but was busy with holiday stuff. Sorry, still plan to take a crack at it!

And yeah, I went through that line of thinking as well.. Also, sending a USR1 works in Apple's JVM but not Oracle's, so there's that.

(edit: FWIW, it gets ugly because you want to invoke USR1/USR2 actions directly but probably still Process#kill anything else, and USR2 doesn't even work on JRuby right now [#1653])

substars added a commit to substars/sidekiq that referenced this issue Dec 10, 2014
substars added a commit to substars/sidekiq that referenced this issue Dec 10, 2014
substars added a commit to substars/sidekiq that referenced this issue Dec 10, 2014
mperham added a commit that referenced this issue Dec 12, 2014
Handle SIGUSR1 and SIGUSR2 as special cases so Sidekiq API works in JRuby. Fixes #2063
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