Reflex + RabbitMQ RPC Timeout in Docker Setup #5337
Unanswered
DmolinaElectroingenium
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I'm running into a specific issue using Reflex inside Docker containers when making long-running RPC calls over RabbitMQ. I’m sharing all details in case anyone has a more robust solution or insight.
🧱 Setup Overview:
📌 The Problem:
When an RPC call takes longer than ~90 seconds, I get this error from the RPC server:
This happens when the server tries to send the response back to the client.
At the same time, the Reflex backend logs this:
Which means: Gunicorn is killing the Reflex backend worker before the RPC response arrives, so the socket is gone, and the server can’t deliver the result.
🧪 What I’ve tried:
import reflex as rx
config = rx.Config(
app_name="Interfaz", # The name of the app (should match the name of the app directory).
api_url="http://localhost:8000", #"http://localhost:8000", The backend url the frontend will connect to. This must be updated if the backend is hosted elsewhere, or in production.
# frontend_path=reflex_frontend, # The path the frontend will be hosted on. This must be updated if the frontend is hosted elsewhere, or in production.
# deploy_url=reflex_frontend, # The url the frontend will be hosted on. This must be updated if the frontend is hosted elsewhere, or in production.
frontend_port=3000, # The port the frontend will be hosted on.
backend_port=8000, # The port the backend will be hosted on.
# cors_allowed_origins=[reflex_frontend], # List of origins that are allowed to connect to the backend API.
timeout= 300, # TEST
gunicorn_workers= 1, # The number of gunicorn workers to use. This should be set to the number of CPU cores available.
gunicorn_worker_class = "uvicorn.workers.UvicornWorker"
)
but is not working.
I’d like to:
Has anyone successfully increased the Gunicorn timeout ?
Any suggestions or patterns that work better for long-lived RPC interactions with Reflex?
Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions