File: global_configurations.rst

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (49 lines) | stat: -rw-r--r-- 1,484 bytes parent folder | download | duplicates (4)
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
.. -*- rst -*-

.. highlightlang:: none

Global configurations
=====================

Summary
-------

Groonga has the global configurations. You can access them by API.


Reference
---------

.. c:function:: int grn_get_lock_timeout(void)

   Returns the lock timeout.

   :c:type:`grn_ctx` acquires a lock for updating a shared value. If
   other :c:type:`grn_ctx` is already updating the same value,
   :c:type:`grn_ctx` that try to acquire a lock can't acquires a lock.
   The :c:type:`grn_ctx` that can't acquires a lock waits 1
   millisecond and try to acquire a lock again. The try is done
   ``timeout`` times. If the :c:type:`grn_ctx` that can't acquires a
   lock until ``timeout`` times, the tries are failed.

   The default lock timeout is ``10000000``. It means that Groonga
   doesn't report a lock failure until about 3 hours.  (1 * 10000000
   [msec] = 10000 [sec] = 166.666... [min] = 2.777... [hour])

   :return: The lock timeout.

.. c:function:: grn_rc grn_set_lock_timeout(int timeout)

   Sets the lock timeout.

   See :c:func:`grn_get_lock_timeout` about lock timeout.

   There are some special values for ``timeout``.

     * ``0``: It means that Groonga doesn't retry acquiring a lock.
       Groonga reports a failure after one lock acquirement failure.
     * negative value: It means that Groonga retries acquiring a lock
       until Groonga can acquire a lock.

   :param timeuot: The new lock timeout.
   :return: ``GRN_SUCCESS``. It doesn't fail.