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:
657
657
658
658
See the `Supervisor docs `_ for more details.
659
659
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
+
660
677
.. _messenger-retries-failures :
661
678
662
679
Retries & Failures
@@ -2020,6 +2037,7 @@ Learn more
2020
2037
.. _`Enqueue's transport` : https://github.com/sroze/messenger-enqueue-transport
2021
2038
.. _`streams` : https://redis.io/topics/streams-intro
2022
2039
.. _`Supervisor docs` : http://supervisord.org/
2040
+ .. _`PCNTL` : https://www.php.net/manual/book.pcntl.php
2023
2041
.. _`SymfonyCasts' message serializer tutorial` : https://symfonycasts.com/screencast/messenger/transport-serializer
2024
2042
.. _`Long polling` : https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html
2025
2043
.. _`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