]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Fix a couple of problems with local deliveries.
authorPeter Pentchev <roam@ringlet.net>
Mon, 28 Jun 2010 14:21:20 +0000 (14:21 +0000)
committerPeter Pentchev <roam@ringlet.net>
Mon, 28 Jun 2010 14:21:20 +0000 (14:21 +0000)
changelog
patches/35-delivery-retry.patch [new file with mode: 0644]
patches/series

index a007473d55cf2154fe58a9b1fe7b3f9e2f81cdb8..575bdc1e1dfa1f004f3e5e2ce7e1f30adababe50 100644 (file)
--- a/changelog
+++ b/changelog
@@ -69,6 +69,8 @@ dma (0.0.2010.06.17-1) UNRELEASED; urgency=low
   * Add the 34-manpage-defaults patch to properly document what dma will use
     as default values if not specified in the config file instead of what
     the default config file specifies.  Closes: #544748
+  * Add the 35-delivery-retry patch to try local deliveries a bit more often
+    and to randomize the delivery timeout to avoid locking issues.
 
  -- Peter Pentchev <roam@ringlet.net>  Fri, 25 Jun 2010 12:02:22 +0300
 
diff --git a/patches/35-delivery-retry.patch b/patches/35-delivery-retry.patch
new file mode 100644 (file)
index 0000000..fd7bf7e
--- /dev/null
@@ -0,0 +1,44 @@
+Description: Randomize the retry timeouts a bit.
+Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-06-28
+
+--- a/dma.c
++++ b/dma.c
+@@ -276,7 +276,7 @@
+ deliver(struct qitem *it)
+ {
+       int error;
+-      unsigned int backoff = MIN_RETRY;
++      unsigned int backoff = it->remote? MIN_RETRY: MIN_RETRY_LOCAL;
+       const char *errmsg = "unknown bounce reason";
+       struct timeval now;
+       struct stat st;
+@@ -313,7 +313,13 @@
+                               "delay cannot be interrupted");
+               sleep(backoff);
+               signal(SIGALRM, SIG_DFL);
+-              backoff *= 2;
++              backoff = backoff * 2 + (
++#ifdef HAVE_RANDOM
++                      random()
++#else
++                      rand()
++#endif
++                      % RETRY_JITTER);
+               if (backoff > MAX_RETRY)
+                       backoff = MAX_RETRY;
+               goto retry;
+--- a/dma.h
++++ b/dma.h
+@@ -48,7 +48,9 @@
+ #define BUF_SIZE      2048
+ #define MIN_RETRY     300             /* 5 minutes */
++#define MIN_RETRY_LOCAL       30              /* 30 seconds */
+ #define MAX_RETRY     (3*60*60)       /* retry at least every 3 hours */
++#define RETRY_JITTER  10
+ #define MAX_TIMEOUT   (5*24*60*60)    /* give up after 5 days */
+ #ifndef PATH_MAX
+ #define PATH_MAX      1024            /* Max path len */
index 75f10385fd1aa23267e6b607345c48ad619327f2..a384032d2990f51dd18bdec0483b9dd7eeb0bdb1 100644 (file)
@@ -17,3 +17,4 @@
 32-comment-uncomment.patch
 33-opportunistic-tls.patch
 34-manpage-defaults.patch
+35-delivery-retry.patch