<commit_before>.. -*- rst -*-

.. highlightlang:: none

.. 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.

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


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``
     - 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``.
<commit_msg>doc shutdown: add missing metadata<commit_after>.. -*- rst -*-

.. highlightlang:: none

.. 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.


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``.

{'fraction_non_alphanumeric': 0.14276622825625795, 'fraction_numerical': 0.0016970725498515061, 'mean_word_length': 3.631630648330059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6122374', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1241, 'n_words': 480}