From bf8b285acb8c2500e52ae2582f27513b9842de54 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 1 Jun 2011 17:09:32 -0400 Subject: Major terminology shift: * Queue runners are now called just 'Runners' since several of them don't manage queue directories. * Ban the term 'qrunner' too. * The master queue runner watcher should now just be called the 'master' or the 'master runner'. * bin/qrunner -> bin/runner * mailman.qrunner log file -> mailman.runner * master-qrunner.lck -> master.lck * master-qrunner.pid -> master.pid Also: * Remove some obsolete files * Begin the .txt -> .rst renaming --- src/mailman/bin/docs/master.rst | 53 +++++++++++++++++++++++++++++++++++++++++ src/mailman/bin/docs/master.txt | 51 --------------------------------------- 2 files changed, 53 insertions(+), 51 deletions(-) create mode 100644 src/mailman/bin/docs/master.rst delete mode 100644 src/mailman/bin/docs/master.txt (limited to 'src/mailman/bin/docs') diff --git a/src/mailman/bin/docs/master.rst b/src/mailman/bin/docs/master.rst new file mode 100644 index 000000000..c4410bf16 --- /dev/null +++ b/src/mailman/bin/docs/master.rst @@ -0,0 +1,53 @@ +====================== +Mailman runner control +====================== + +Mailman has a number of *runner subprocesses* which perform long-running tasks +such as listening on an LMTP port, processing REST API requests, or processing +messages in a queue directory. In normal operation, the ``bin/mailman`` +command is used to start, stop and manage the runners. This is just a wrapper +around the real master watcher, which handles runner starting, stopping, +exiting, and log file reopening. + + >>> from mailman.testing.helpers import TestableMaster + +Start the master in a sub-thread. + + >>> master = TestableMaster() + >>> master.start() + +There should be a process id for every runner that claims to be startable. + + >>> from lazr.config import as_boolean + >>> startable_runners = [conf for conf in config.runner_configs + ... if as_boolean(conf.start)] + >>> len(list(master.runner_pids)) == len(startable_runners) + True + +Now verify that all the runners are running. +:: + + >>> import os + + # This should produce no output. + >>> for pid in master.runner_pids: + ... os.kill(pid, 0) + +Stop the master process, which should also kill (and not restart) the child +runner processes. + + >>> master.stop() + +None of the children are running now. + + >>> import errno + >>> for pid in master.runner_pids: + ... try: + ... os.kill(pid, 0) + ... print 'Process did not exit:', pid + ... except OSError as error: + ... if error.errno == errno.ESRCH: + ... # The child process exited. + ... pass + ... else: + ... raise diff --git a/src/mailman/bin/docs/master.txt b/src/mailman/bin/docs/master.txt deleted file mode 100644 index d3c07c768..000000000 --- a/src/mailman/bin/docs/master.txt +++ /dev/null @@ -1,51 +0,0 @@ -============================ -Mailman queue runner control -============================ - -Mailman has a number of queue runners which process messages in its queue file -directories. In normal operation, the ``bin/mailman`` command is used to -start, stop and manage the queue runners. This is just a wrapper around the -real queue runner watcher script called master.py. - - >>> from mailman.testing.helpers import TestableMaster - -Start the master in a sub-thread. - - >>> master = TestableMaster() - >>> master.start() - -There should be a process id for every qrunner that claims to be startable. - - >>> from lazr.config import as_boolean - >>> startable_qrunners = [qconf for qconf in config.qrunner_configs - ... if as_boolean(qconf.start)] - >>> len(list(master.qrunner_pids)) == len(startable_qrunners) - True - -Now verify that all the qrunners are running. -:: - - >>> import os - - # This should produce no output. - >>> for pid in master.qrunner_pids: - ... os.kill(pid, 0) - -Stop the master process, which should also kill (and not restart) the child -queue runner processes. - - >>> master.stop() - -None of the children are running now. - - >>> import errno - >>> for pid in master.qrunner_pids: - ... try: - ... os.kill(pid, 0) - ... print 'Process did not exit:', pid - ... except OSError, error: - ... if error.errno == errno.ESRCH: - ... # The child process exited. - ... pass - ... else: - ... raise -- cgit v1.2.3-70-g09d2