MAN page from CentOS 8 libdb-utils-5.3.28-36.el8.x86_64.rpm
Section: BerkeleyDB Utilities (1)
Updated: 06 December 2016Index
db_deadlock - Detect deadlocks and abort lock requests
[-Vv] [-a e | m | n | o | W | w | y ][-h home
] [-L file
] [-t sec.usec
utility traverses the database environment lock region, andaborts a lock request each time it detects a deadlock or a lock request thathas timed out. By default, in the case of a deadlock, a random lock request ischosen to be aborted.
This utility should be run as a background daemon, or the underlying BerkeleyDB deadlock detection interfaces should be called in some other way, wheneverthere are multiple threads or processes accessing a database and at least oneof them is modifying it.
- When a deadlock is detected, abort the locker:
- with the most locks
- with the fewest locks
- with the oldest lock
- with the most write locks
- with the fewest write locks
- with the youngest lock
- When lock or transaction timeouts have been specified:
- abort any lock request that has timed out
- -h home
- Specify a home directory for the database environment; bydefault, the current working directory is used.
- -L file
- Log the execution of the db_deadlock utility to the specified file in thefollowing format, where ### is the process ID, and the dateis the time the utility was started.
db_deadlock: ### Wed Jun 15 01:23:45 EDT 1995
This file will be removed if the db_deadlock utility exits gracefully.
- -t sec.usec
- Check the database environment every sec seconds plususec microseconds to see if a process has been forced to waitfor a lock; if one has, review the database environment lockstructures.
- Write the library version number to the standard output, and exit.
- Run in verbose mode, generating messages each time the detector runs.
If the -t option is not specified, db_deadlock willrun once and exit.
The db_deadlock utility uses a Berkeley DB environment (as described for the-h option, the environment variable DB_HOME, orbecause the utility was run in a directory containing a Berkeley DBenvironment). In order to avoid environment corruption when using aBerkeley DB environment, db_deadlock should always be given the chance todetach from the environment and exit gracefully. To cause db_deadlockto release all environment resources and exit cleanly, send it aninterrupt signal (SIGINT).
The db_deadlock utility does not attempt to create the Berkeley DBshared memory regions if they do not already exist. The applicationwhich creates the region should be started first, and then, once theregion is created, the db_deadlock utility should be started.
The DB_ENV->lock_detect method is the underlying method used by thedb_deadlock utility. See the db_deadlock utility source code for anexample of using DB_ENV->lock_detectin a IEEE/ANSI Std 1003.1 (POSIX) environment.
utility exits 0 on success, and >0 if an error occurs.
- If the -h option is not specified and the environment variableDB_HOME is set, it is used as the path of the database home, as describedin DB_ENV->open.
- EXIT STATUS
- SEE ALSO
This document was created byman2html,using the manual pages.