File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,23 @@ Next, tell Supervisor to read your config and start your workers:
657657
658658 See the `Supervisor docs `_ for more details.
659659
660+ Graceful Shutdown
661+ ~~~~~~~~~~~~~~~~~
662+
663+ If you install the `PCNTL `_ PHP extension in your project, workers will handle
664+ the ``SIGTERM `` POSIX signal to finish processing their current message before
665+ exiting.
666+
667+ In some cases the ``SIGTERM `` signal is sent by Supervisor itself (e.g. stopping
668+ a Docker container having Supervisor as its entrypoint). In these cases you
669+ need to add a ``stopwaitsecs `` key to the program configuration (with a value
670+ of the desired grace period in seconds) in order to perform a graceful shutdown:
671+
672+ .. code-block :: ini
673+
674+ [program:x]
675+ stopwaitsecs =20
676+
660677 .. _messenger-retries-failures :
661678
662679Retries & Failures
@@ -2020,6 +2037,7 @@ Learn more
20202037.. _`Enqueue's transport` : https://github.com/sroze/messenger-enqueue-transport
20212038.. _`streams` : https://redis.io/topics/streams-intro
20222039.. _`Supervisor docs` : http://supervisord.org/
2040+ .. _`PCNTL` : https://www.php.net/manual/book.pcntl.php
20232041.. _`SymfonyCasts' message serializer tutorial` : https://symfonycasts.com/screencast/messenger/transport-serializer
20242042.. _`Long polling` : https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html
20252043.. _`Visibility Timeout` : https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html
You can’t perform that action at this time.
0 commit comments