Standard action for $ydb_procstuckexec to invoke
Final Release Note
%YDBPROCSTUCKEXEC is a standard utility program to capture diagnostics when invoked by the ydb_procstuckexec mechanism. To use it, set the ydb_procstuckexec
environment variable to $ydb_dist/yottadb -run %YDBPROCSTUCKEXEC
with $ydb_dist
expanded to the actual directory where YottaDB is installed, or to yottadb -run %YDBPROCSTUCKEXEC
when yottadb
is located by $PATH
. Also $ydb_dist/libyottadbutil.so
must be in the routine search path defined by $ydb_routines
at process startup, or in the $ZROUTINES intrinsic special variable. When invoked by yottadb -run %YDBPROCSTUCKEXEC <msg> <callingpid> <blockingpid> <count>
as described in the ydb_procstuckexec documentation, it creates in the directory specified by $ydb_log
, $gtm_log
, $ydb_tmp
, or $gtm_tmp
(defaulting to /tmp
) a file whose name is %YDBPROCSTUCKEXEC_<date>,<time>_<msg>_<callingpid>_<blockingpid>_<count>_<%YDBPROCSTUCEXECpid>.out
where the ,
- A summary of the invocation, e.g.,
Invoked on 91987 by 91998 for 1st time; reason: MUTEXLCKALERT
. - The command line of the blocking process.
- The environment of the blocking process.
- The value of
/proc/sys/kernel/yama/ptrace_scope
(if non-zero, gdb may not be able to capture the blocking process for a snapshot of its state). - A snapshot of the state of the blocking process, captured by gdb.
- The value returned by $ZSIGPROC() used to send SIGUSR1 (a MUPIP INTRPT) to the blocking pid. If appropriately configured (with ydb_zinterrupt / $ZINTERRUPT, the blocking process will create a dump file of its process state.
If the calling pid and blocking pid are of different uids, the functionality of %YDBPROCSTUCKEXEC is reduced. Depending on security and system administration considerations of the system, it may be appropriate in such cases to create a small setuid root shell script to invoke %YDBPROCSTUCKEXEC. Depending your specific requirements, it may be appropriate to copy and adapt the standard routine for your environment.
Previously, YottaDB provided the ydb_procstuckexec
mechanism for a blocked process to invoke a monitoring script, but not a specific tool. [#579 (closed)]
Description
The ydb_procstuckexec environment variable points to a script to help troubleshoot stuck processes, but leaves it up to DevOps at user sites to create such a script. YottaDB should include such a script that should provide useful information on its own, but which a user site can of course adapt to their needs.
Note: since the script is troubleshooting database access issues, it should use MUPIP DUMPFHEAD, rather than opening a database file, should such a need arise.