File: shutdown.rst

package info (click to toggle)
groonga 15.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 163,080 kB
  • sloc: ansic: 770,564; cpp: 48,925; ruby: 40,447; javascript: 10,250; yacc: 7,045; sh: 5,602; python: 2,821; makefile: 1,672
file content (118 lines) | stat: -rw-r--r-- 2,649 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
.. -*- rst -*-

.. groonga-command
.. database: commands_table_shutdown

``shutdown``
============

Summary
-------

``shutdown`` stops the Groonga server process.

``shutdown`` uses graceful shutdown by default. If there are some
running commands, the Groonga server process stops after these running
commands are finished. New command requests aren't processed after
``shutdown`` command is executed.

.. versionadded:: 6.0.1

   ``shutdown`` uses immediate shutdown by specifying ``immediate`` to
   ``mode`` parameter. The Groonga server process stops immediately
   even when there are some running commands.

   .. note::

      You need to set :doc:`/reference/command/request_id` to all
      requests to use immediate shutdown.

.. versionadded:: 9.1.2

   The Groonga HTTP server accepts immediate shutdown immediately even when all threads are used.

   .. note::

     This feature can only use on the Groonga HTTP server.

Syntax
------

This command takes only one optional parameter::

  shutdown [mode=graceful]

Usage
-----

``shutdown`` use graceful shutdown by default:

.. groonga-command
.. include:: ../../example/reference/commands/shutdown/default.log
.. shutdown

You can specify ``graceful`` to ``mode`` parameter explicitly:

.. groonga-command
.. database: commands_table_shutdown
.. include:: ../../example/reference/commands/shutdown/graceful.log
.. shutdown --mode graceful

You can choose immediate shutdown by specifying ``immediate`` to
``mode`` parameter:

.. groonga-command
.. database: commands_table_shutdown
.. include:: ../../example/reference/commands/shutdown/immediate.log
.. shutdown --mode immediate

Immediate shutdown is useful when you don't have time for graceful
shutdown. For example, Windows kills service that takes long time to
stop on Windows shutdown.

Parameters
----------

This section describes parameters of this command.

Required parameters
^^^^^^^^^^^^^^^^^^^

There is no required parameter.

Optional parameters
^^^^^^^^^^^^^^^^^^^

There are optional parameters.

``mode``
""""""""

Specifies shutdown mode. Here are available shutdown modes:

.. list-table::
   :header-rows: 1

   * - Value
     - Description
   * - ``graceful``
     - Stops after running commands are finished.

       This is the default.
   * - ``immediate``
     - .. versionadded:: 6.0.1

          Stops immediately even if there are some running commands.

Return value
------------

``shutdown`` returns ``true`` as body when shutdown is
accepted::

  [HEADER, true]

If ``shutdown`` doesn't accept shutdown, error details are in
``HEADER``.

See :doc:`/reference/command/output_format` for ``HEADER``.