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

RQ Job Terminated Unexpectedly #625

Open
rcthakuri opened this issue Sep 19, 2023 · 2 comments
Open

RQ Job Terminated Unexpectedly #625

rcthakuri opened this issue Sep 19, 2023 · 2 comments

Comments

@rcthakuri
Copy link

I have defined the rq task on module task.py as:

import django_rq
import logging
import requests

log = logging.getLogger(__name__)


def req_call():
    url = 'https://jsonplaceholder.typicode.com/posts'
    response = requests.get(url)
    return response


@django_rq.job('default')
def test_request_call_on_rq_job():
    response = req_call()
    log.warning(f'REQUEST's RESPONSE {response.json()}')

When I've offloaded task in another module as:

if __name__ == '__main__':  # rq job test
    log.setLevel(logging.DEBUG)
    test_post_request_on_rq_job.delay()

I am getting error as:

[INFO] *** Listening on default...  [worker:702]
[INFO] default: rq_test_module.tasks.test_request_call_on_rq_job() (676c1945-9e05-4245-aeb2-65100cdb4169)  [worker:875]
[WARNING] Moving job to FailedJobRegistry (Work-horse terminated unexpectedly; waitpid returned 11 (signal 11); )  [worker:1114]

I then started doing debugging, then I saw error encounters as soon as the job task tried executing the request call i.e. requests.get(url)
And if I remove the request call from the job, then it executed gracefully without any errors.

Signal 11 indicates a segmentation fault, I suspect something related to memory but not quite sure about it.

So anyone here encountered similar issue and workaround for this :)

@ramchandra-st
Copy link

I think I found the cause of the request being not executed gracefully on rq. I bet it was due to **https://github.com/python/cpython/blob/main/Lib/urllib/request.py#L2619 not able to find that library. So I just skipped the way to reach there by setting NO_PROXY env to the URL I am trying to request.

I guess, we can close this, now.

@zanderle
Copy link

I had this issue to, and found a similar explanation to yours. So simply setting export NO_PROXY=* resolved my issue.

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

3 participants