Re: [exim] exim 4.50 turns into a cpu hog

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Hirling Endre
CC: exim-users
Temat: Re: [exim] exim 4.50 turns into a cpu hog
On Tue, 5 Apr 2005, Hirling Endre wrote:

> The patch below moves setting nexthost after the check for the usability
> of the current host, so if the current host is not usable, exim will
> recheck it in an endless loop instead of skipping to the next.


Aarrgghh!! What a stupid idiot I am. Yes, indeed, the patch is broken.
Below is a corrected patch, which adds the same resetting code as
before, but does NOT remove the previous setting, which should remain
for use in cases when no lookup is done (such as the case that bit you).

Philip

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



*** exim-4.50/src/transports/smtp.c Thu Feb 17 14:49:11 2005
--- transports/smtp.c    Thu Apr  7 11:44:17 2005
***************
*** 2134,2140 ****
      uschar *serialize_key = NULL;


      /* Default next host is next host. :-) But this can vary if the
!     hosts_max_try limit is hit (see below). */


      nexthost = host->next;


--- 2176,2183 ----
      uschar *serialize_key = NULL;


      /* Default next host is next host. :-) But this can vary if the
!     hosts_max_try limit is hit (see below). It may also be reset if a host 
!     address is looked up here (in case the host was multihomed). */


      nexthost = host->next;


***************
*** 2244,2249 ****
--- 2287,2297 ----
        continue;      /* With next host */
        }


+     /* Reset the default next host in case a multihomed host whose addresses 
+     are not looked up till just above added to the host list. */
+ 
+     nexthost = host->next;
+ 
      /* If queue_smtp is set (-odqs or the first part of a 2-stage run), or the
      domain is in queue_smtp_domains, we don't actually want to attempt any
      deliveries. When doing a queue run, queue_smtp_domains is always unset. If