Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

370
Views
Redis Rq giving error waitpid returned 6 for FastAPI

I am trying to execute a function through rq worker. This is the error i get:

objc[4463]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
    objc[4463]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
    16:35:40 Moving job to FailedJobRegistry (work-horse terminated unexpectedly; waitpid returned 6)

This is how I am adding the task in the queue. It is Fast Api route

    r=RedisQueue.get_redis()
    q=Queue(connection=r)
    job=q.enqueue(export_testcases_to_xlsx,testcases,token)
    RedisQueue.get_worker(r)

I have a redisqueue.py file which is like this:

import redis
from rq import Queue,Connection,Worker
from rq.job import Job
from app.model.Settings import Settings
import sys,os

settings=Settings()
class RedisQueue:
    @staticmethod
    def get_redis():
        # To run on container
        if settings.redis_host:
            r = redis.Redis(host=settings.redis_host, port=settings.redis_port)
        # To run locally
        else:
            r = redis.Redis()
        return r
    def get_worker(r):
        listen = ['default']
        with Connection(r):
            
            worker = Worker(list(map(Queue, listen)))
            worker.work()

When I don't start the worker through the get_worker function and directly use rq worker command in the terminal to start the worker it is working fine.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!