NAME

DBIx::QuickDB::Watcher - Daemon that sits between main process and the server.

DESCRIPTION

When a database is spun up a 'db-quick-watcher' process is started. This process has 1 job: Make sure cleanup happens. This process is a daemon completely disconnected from the process that requested the database, and the db-server is a process under it.

If this process detects that your main process goes away (exited, killed, etc) this process will kill the database server and delete the data dir, then exit.

The main process can also send signals to this one to make it stop, clean up, etc.

SIGNALS

SIGINT - Stop the server, but do not delete the data

This will stop the server, but keep the data dir intact.

SIGTERM - Stop the server, delete the data

This will stop the server, and if the instance is supposed to be cleaned up then the data dir will be deleted.

SIGUSR1 - Fast eliminate: kill the server immediately, delete the data

Like SIGTERM, but the server is killed straight away with the driver's fast_stop_sig() (SIGKILL by default, or a clean immediate-shutdown signal the driver picks to avoid leaking OS resources) instead of being given a chance to shut down gracefully, then reaped -- escalating to SIGKILL if it does not exit promptly -- then the data dir is removed. Used for disposable clones being deleted (see "destroy_quietly" in DBIx::QuickDB::Driver). The watcher blocks this signal across its startup exec so a fast-eliminate that races server startup stays pending rather than being lost.

SIGHUP - Do not report errors

This will tell the daemon not to report when the server exits badly. This is mainly used for garbage collection purposes.

SOURCE

The source code repository for DBIx-QuickDB can be found at https://github.com/exodist/DBIx-QuickDB/.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2020 Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/