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

Error "signal only works in main thread of the main interpreter" after a system failure #2086

Open
tsunamilx opened this issue May 6, 2024 · 1 comment

Comments

@tsunamilx
Copy link

Hi guys,

I am simulating a system failure: I setup a test server on AWS, ran a couple of tasks that take long time using RQ, then stop instance from AWS console, then restart it.

Now I get the error "signal only works in main thread of the main interpreter" and cannot get any queue information from RQ. I had to flush all from Redis in order to get RQ working again, but then I lost all queue information / task progression.

The error might not be directly from RQ, just want to know if there is any way to get rid of this error and get the queue data from RQ? Thanks.

The raw error:

ValueError: signal only works in main thread of the main interpreter
  File "rq/job.py", line 1428, in execute_failure_callback
    with death_penalty_class(self.failure_callback_timeout, JobTimeoutException, job_id=self.id):
  File "rq/timeouts.py", line 36, in __enter__
    self.setup_death_penalty()
  File "rq/timeouts.py", line 69, in setup_death_penalty
    signal.signal(signal.SIGALRM, self.handle_death_penalty)
  File "signal.py", line 56, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
@tsunamilx
Copy link
Author

Edit: right after I posted this, the error is gone... now I can get the queue data, everything seems to be working. Can someone explain what's going on?

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

1 participant