/[smecontribs]/rpms/mailman/contribs8/mailman-2.1.9-broken-queue.patch
ViewVC logotype

Annotation of /rpms/mailman/contribs8/mailman-2.1.9-broken-queue.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (hide annotations) (download)
Fri Jul 12 21:04:21 2013 UTC (11 years, 4 months ago) by unnilennium
Branch: MAIN
CVS Tags: mailman-2_1_9-6_el5_6_1, mailman-2_1_9-20_el5_sme, mailman-2_1_9-6_el5_sme_20, HEAD
import new srpm

1 unnilennium 1.1 diff -up mailman-2.1.9/Mailman/Queue/Runner.py.backup mailman-2.1.9/Mailman/Queue/Runner.py
2     --- mailman-2.1.9/Mailman/Queue/Runner.py.backup 2009-10-20 14:33:03.000000000 +0200
3     +++ mailman-2.1.9/Mailman/Queue/Runner.py 2009-10-20 14:33:55.000000000 +0200
4     @@ -98,7 +98,7 @@ class Runner:
5     # Ask the switchboard for the message and metadata objects
6     # associated with this filebase.
7     msg, msgdata = self._switchboard.dequeue(filebase)
8     - except email.Errors.MessageParseError, e:
9     + except Exception, e:
10     # It's possible to get here if the message was stored in the
11     # pickle in plain text, and the metadata had a _parsemsg key
12     # that was true, /and/ if the message had some bogosity in
13     @@ -106,7 +106,8 @@ class Runner:
14     # There's not much we can do (and we didn't even get the
15     # metadata, so just log the exception and continue.
16     self._log(e)
17     - syslog('error', 'Ignoring unparseable message: %s', filebase)
18     + syslog('error', 'Skipping and preserving unparseable message: %s', filebase)
19     + self._switchboard.finish(filebase, preserve=True)
20     continue
21     try:
22     self._onefile(msg, msgdata)
23     @@ -121,9 +122,14 @@ class Runner:
24     self._log(e)
25     # Put a marker in the metadata for unshunting
26     msgdata['whichq'] = self._switchboard.whichq()
27     - new_filebase = self._shunt.enqueue(msg, msgdata)
28     - syslog('error', 'SHUNTING: %s', new_filebase)
29     - self._switchboard.finish(filebase)
30     + try:
31     + new_filebase = self._shunt.enqueue(msg, msgdata)
32     + syslog('error', 'SHUNTING: %s', new_filebase)
33     + self._switchboard.finish(filebase)
34     + except Exception, e:
35     + self._log(e)
36     + syslog('error','SHUNTING FAILED, preserving original entry: %s', filebase)
37     + self._switchboard.finish(filebase, preserve=True)
38     # Other work we want to do each time through the loop
39     Utils.reap(self._kids, once=True)
40     self._doperiodic()
41     diff -up mailman-2.1.9/Mailman/Queue/Switchboard.py.backup mailman-2.1.9/Mailman/Queue/Switchboard.py
42     --- mailman-2.1.9/Mailman/Queue/Switchboard.py.backup 2009-10-20 14:33:22.000000000 +0200
43     +++ mailman-2.1.9/Mailman/Queue/Switchboard.py 2009-10-20 14:33:48.000000000 +0200
44     @@ -164,12 +164,24 @@ class Switchboard:
45     msg = email.message_from_string(msg, Message.Message)
46     return msg, data
47    
48     - def finish(self, filebase):
49     + def finish(self, filebase, preserve=False):
50     bakfile = os.path.join(self.__whichq, filebase + '.bak')
51     try:
52     - os.unlink(bakfile)
53     + if preserve:
54     + psvfile = os.path.join(mm_cfg.SHUNTQUEUE_DIR, filebase + '.psv')
55     + omask = os.umask(0) # rwxrws---
56     + try:
57     + try:
58     + os.mkdir(mm_cfg.SHUNTQUEUE_DIR, 0770)
59     + except OSError, e:
60     + if e.errno <> errno.EEXIST: raise
61     + finally:
62     + os.umask(omask)
63     + os.rename(bakfile, psvfile)
64     + else:
65     + os.unlink(bakfile)
66     except EnvironmentError, e:
67     - syslog('error', 'Failed to unlink backup file: %s', bakfile)
68     + syslog('error', 'Failed to unlink/preserve backup file: %s', bakfile)
69    
70     def files(self, extension='.pck'):
71     times = {}

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed