File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -653,6 +653,20 @@ config and start your workers:
653
653
654
654
See the `Supervisor docs `_ for more details.
655
655
656
+ Graceful Shutdown
657
+ ~~~~~~~~~~~~~~~~~
658
+
659
+ Workers can handle the ``SIGTERM `` POSIX signal to finish handling their
660
+ current message before exiting, as long as the `PCNTL `_ extension is installed.
661
+
662
+ .. tip ::
663
+
664
+ In some cases the ``SIGTERM `` signal is sent by Supervisor itself (e.g.
665
+ stopping a Docker container having Supervisor as its entrypoint).
666
+ In these cases you need to add a ``stopwaitsecs `` key to the program
667
+ configuration (with a value of the desired grace period in seconds)
668
+ in order to perform a graceful shutdown.
669
+
656
670
.. _messenger-retries-failures :
657
671
658
672
Retries & Failures
@@ -1747,4 +1761,5 @@ Learn more
1747
1761
.. _`Enqueue's transport` : https://github.com/sroze/messenger-enqueue-transport
1748
1762
.. _`streams` : https://redis.io/topics/streams-intro
1749
1763
.. _`Supervisor docs` : http://supervisord.org/
1764
+ .. _`PCNTL` : https://www.php.net/manual/book.pcntl.php
1750
1765
.. _`SymfonyCasts' message serializer tutorial` : https://symfonycasts.com/screencast/messenger/transport-serializer
You can’t perform that action at this time.
0 commit comments