Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

360
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda