diff options
| author | Barry Warsaw | 2011-06-01 17:09:32 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-06-01 17:09:32 -0400 |
| commit | bf8b285acb8c2500e52ae2582f27513b9842de54 (patch) | |
| tree | 53e30be0bb665d66a9350fe58d22697c4c0a860e /src/mailman/core | |
| parent | 0f85fb344688e1982e9320e79b7fb38eefc1ac53 (diff) | |
| download | mailman-bf8b285acb8c2500e52ae2582f27513b9842de54.tar.gz mailman-bf8b285acb8c2500e52ae2582f27513b9842de54.tar.zst mailman-bf8b285acb8c2500e52ae2582f27513b9842de54.zip | |
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
Diffstat (limited to 'src/mailman/core')
| -rw-r--r-- | src/mailman/core/docs/runner.rst (renamed from src/mailman/core/docs/runner.txt) | 38 | ||||
| -rw-r--r-- | src/mailman/core/logging.py | 3 | ||||
| -rw-r--r-- | src/mailman/core/runner.py | 11 | ||||
| -rw-r--r-- | src/mailman/core/switchboard.py | 6 |
4 files changed, 30 insertions, 28 deletions
diff --git a/src/mailman/core/docs/runner.txt b/src/mailman/core/docs/runner.rst index 4262dc87a..00781578f 100644 --- a/src/mailman/core/docs/runner.txt +++ b/src/mailman/core/docs/runner.rst @@ -1,30 +1,32 @@ -============= -Queue runners -============= +======= +Runners +======= -The queue runners (*qrunner*) are the processes that move messages around the -Mailman system. Each qrunner is responsible for a slice of the hash space in -a queue directory. It processes all the files in its slice, sleeps a little -while, then wakes up and runs through its queue files again. +The *runners* are the processes that perform long-running tasks, such as +moving messages around the Mailman queues. Some runners don't manage queues, +such as the LMTP and REST API handling runners. Each runner that manages a +queue directory though, is responsible for a slice of the hash space. It +processes all the files in its slice, sleeps a little while, then wakes up and +runs through its queue files again. Basic architecture ================== -The basic architecture of qrunner is implemented in the base class that all +The basic architecture of runner is implemented in the base class that all runners inherit from. This base class implements a ``.run()`` method that runs continuously in a loop until the ``.stop()`` method is called. - >>> mlist = create_list('_xtest@example.com') + >>> mlist = create_list('test@example.com') -Here is a very simple derived qrunner class. Queue runners use a -configuration section in the configuration files to determine run -characteristics, such as the queue directory to use. Here we push a -configuration section for the test runner. +Here is a very simple derived runner class. Runners use a configuration +section in the configuration files to determine run characteristics, such as +the queue directory to use. Here we push a configuration section for the test +runner. :: >>> config.push('test-runner', """ - ... [qrunner.test] + ... [runner.test] ... max_restarts: 1 ... """) @@ -43,12 +45,12 @@ configuration section for the test runner. >>> runner = TestableRunner('test') -This qrunner doesn't do much except run once, storing the message and metadata +This runner doesn't do much except run once, storing the message and metadata on instance variables. >>> msg = message_from_string("""\ ... From: aperson@example.com - ... To: _xtest@example.com + ... To: test@example.com ... ... A test message. ... """) @@ -58,7 +60,7 @@ on instance variables. >>> runner.run() >>> print runner.msg.as_string() From: aperson@example.com - To: _xtest@example.com + To: test@example.com <BLANKLINE> A test message. <BLANKLINE> @@ -67,7 +69,7 @@ on instance variables. bar : no foo : yes lang : en - listname : _xtest@example.com + listname : test@example.com version : 3 XXX More of the Runner API should be tested. diff --git a/src/mailman/core/logging.py b/src/mailman/core/logging.py index 0ff129897..09efd7771 100644 --- a/src/mailman/core/logging.py +++ b/src/mailman/core/logging.py @@ -130,8 +130,7 @@ def initialize(propagate=None): log_format = logger_config.format log_datefmt = logger_config.datefmt # Propagation to the root logger is how we handle logging to stderr - # when the queue runners are not run as a subprocess of 'bin/mailman - # start'. + # when the runners are not run as a subprocess of 'bin/mailman start'. log.propagate = (as_boolean(logger_config.propagate) if propagate is None else propagate) # Set the logger's level. diff --git a/src/mailman/core/runner.py b/src/mailman/core/runner.py index 3d876ac3d..c24563e68 100644 --- a/src/mailman/core/runner.py +++ b/src/mailman/core/runner.py @@ -54,15 +54,16 @@ class Runner: intercept_signals = True def __init__(self, name, slice=None): - """Create a queue runner. + """Create a runner. - :param slice: The slice number for this queue runner. This is passed - directly to the underlying `ISwitchboard` object. + :param slice: The slice number for this runner. This is passed + directly to the underlying `ISwitchboard` object. This is ignored + for runners that don't manage a queue. :type slice: int or None """ # Grab the configuration section. self.name = name - section = getattr(config, 'qrunner.' + name) + section = getattr(config, 'runner.' + name) substitutions = config.paths substitutions['name'] = name self.queue_directory = expand(section.path, substitutions) @@ -87,7 +88,7 @@ class Runner: def run(self): """See `IRunner`.""" - # Start the main loop for this queue runner. + # Start the main loop for this runner. try: while True: # Once through the loop that processes all the files in the diff --git a/src/mailman/core/switchboard.py b/src/mailman/core/switchboard.py index 5d9eb65ce..4c7b31a67 100644 --- a/src/mailman/core/switchboard.py +++ b/src/mailman/core/switchboard.py @@ -69,10 +69,10 @@ class Switchboard: @staticmethod def initialize(): """Initialize the global switchboards for input/output.""" - for conf in config.qrunner_configs: + for conf in config.runner_configs: name = conf.name.split('.')[-1] assert name not in config.switchboards, ( - 'Duplicate qrunner name: {0}'.format(name)) + 'Duplicate runner name: {0}'.format(name)) substitutions = config.paths substitutions['name'] = name path = expand(conf.path, substitutions) @@ -118,7 +118,7 @@ class Switchboard: _metadata = {} # Calculate the SHA hexdigest of the message to get a unique base # filename. We're also going to use the digest as a hash into the set - # of parallel qrunner processes. + # of parallel runner processes. data = _metadata.copy() data.update(_kws) listname = data.get('listname', '--nolist--') |
