-
Hi, I am using ApiPlatform/Symfony with the RoadRunner. In the rr.yaml I have number of symfony messenger consume commands defined like this for each transport:
What I would like to do is when the Docker Container receives SIGTERM signal to gracefully shutdown the server by not accepting any more requests and finishing the ongoing ones. In addition I would like to stop any Symfony Messenger workers from processing new messages. Researching, I have found out that there is a Symfony command for stopping the workers to consume any new messages: So currently what I do is:
I would like to somehow integrate the first command to run automatically when a SIGTERM signal is received so I do not need to perform this manual step. Is this possible? In addition starting RoadRunner from a bash script like this: #!/bin/bash
if [ ! -f ".rr.yaml" ]; then cp .rr.example.yaml .rr.yaml; fi
rr serve -d -c .rr.yaml Dockerfile:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @jelovac 👋
|
Beta Was this translation helpful? Give feedback.
Hey @jelovac 👋
-d
option with RR. This option starts a debug/profiling server, which slows down execution significantly.timeout_stop_sec
, you may specify it (should not be less than the overall graceful timeout: link). RR, before stopping the process, sendingSIGINT
into it. So, you may catch this signal inside your worker, process all requests and exit from the process. By setting the proper timeout, you can specify the time which you're allowed to spend finishing already received requests.