[Python] Worker was sent code 139! running Gunicorn + Chroma

Discussão em 'Python' iniciado por Stack, Maio 7, 2025.

  1. Stack

    Stack Membro Participativo

    I have a Flask app that uses Gunicorn/Nginx + ChromaDB v1.0.8. I've had no issues with its functionality till today when I restarted the service, to which I would receive

    May 06 19:33:34 cluster gunicorn[6804]: 2025-05-06 19:33:34.413 | INFO | app:insert:79 - insert: querying chroma for nearest embeddings
    May 06 19:33:34 cluster gunicorn[6802]: [2025-05-06 19:33:34 +0000] [6802] [ERROR] Worker (pid:6804) was sent code 139!
    May 06 19:33:34 cluster gunicorn[6852]: [2025-05-06 19:33:34 +0000] [6852] [INFO] Booting worker with pid: 6852


    This occurs when an endpoint is called to embed data into the vector database (Chroma), specifically when I go to query the collection for an embeddding

    logger.info("insert: querying chroma for nearest embeddings")
    query_result = collection.query(query_embeddings=[embedding], n_results=5)
    distances = query_result["distances"][0]
    metadatas_raw = query_result["metadatas"][0]
    logger.info(f"insert: query returned {len(distances)} distances")


    I've struggled to isolate the issue as ~1 out of 20 restarts will work, with the rest failing. I run Gunicorn with

    ExecStart=/var/www/cluster/.venv/bin/gunicorn -k gthread --threads 4 --workers 1 --timeout 60 --bind unix:/var/www/cluster/cluster.sock -m 007 "app:app"


    I can access the DB directly via the Python interpreter so the issue does not appear to be the database itself. Any ideas on what might be causing this?

    Continue reading...

Compartilhe esta Página