Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Oct 1998 16:38:20 +0200
From:      axl@iafrica.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/8372: [PATCH] exim-2.05 author-contributed performance-related patches
Message-ID:  <E0zVGRw-000455-00@axl.training.iafrica.com>

next in thread | raw e-mail | index | archive | help

>Number:         8372
>Category:       ports
>Synopsis:       [PATCH] exim-2.05 author-contributed performance-related patches
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 19 07:40:01 PDT 1998
>Last-Modified:
>Originator:     Sheldon Hearn
>Organization:
UUNET Internet Africa
>Release:        FreeBSD 2.2.7-STABLE i386
>Environment:

	N/A

>Description:

	Exim's author has published two patches that affect
	performance. One relates to inaccuracies in the exim's
	logfiles, the other to uneccessary delays in delivery retry
	attempts under certain conditions.

>How-To-Repeat:

	

>Fix:
	
	Because the author is trying to slow down the release rate, it should be a while before an exim release includes these patches. Hence, we should carry them in the ports tree until the next official release of exim.

diff -urN mail/exim.orig/patches/patch-ab mail/exim/patches/patch-ab
--- mail/exim.orig/patches/patch-ab	Mon Oct 19 16:30:08 1998
+++ mail/exim/patches/patch-ab	Mon Oct 19 16:12:43 1998
@@ -0,0 +1,173 @@
+Minor bugfix from author
+
+*** src/daemon.c	Thu Oct  8 11:00:08 1998
+--- src/daemon.c	Wed Oct 14 10:50:25 1998
+***************
+*** 275,280 ****
+--- 278,284 ----
+    {
+    int i;
+    int message_count = 0;
++   int queue_only_reason = 0;
+    BOOL local_queue_only = queue_only;
+  
+    /* Close the listening sockets, and set the SIGCHLD handler to SIG_IGN.
+***************
+*** 305,311 ****
+--- 309,318 ----
+    till later so it will have a message id attached. */
+  
+    if (smtp_accept_queue > 0 && smtp_accept_count >= smtp_accept_queue)
++     {
+      local_queue_only = TRUE;
++     queue_only_reason = 1;
++     }
+  
+    /* Handle the start of the SMTP session, then loop, accepting incoming
+    messages from the SMTP connection. The end will come at the QUIT command,
+***************
+*** 383,412 ****
+            ++message_count > smtp_accept_queue_per_connection)
+          {
+          local_queue_only = TRUE;
+!         log_write(4, LOG_MAIN, "no immediate delivery: more than %d messages "
+!           "received in one connection\n", smtp_accept_queue_per_connection);
+          }
+        else if (queue_only_load >= 0)
+          {
+          local_queue_only = (load_average = os_getloadavg()) > queue_only_load;
+!         if (local_queue_only)
+!           log_write(4, LOG_MAIN, "no immediate delivery: load average = %.2f\n",
+!             (double)load_average/1000.0);
+          }
+        }
+  
+      /* Log the queueing here, when it will get a message id attached, but
+!     not if queue_only is set. */
+  
+!     else if (!queue_only) log_write(4, LOG_MAIN,
+!       "no immediate delivery: too many connections (%d, max %d)\n",
+!         smtp_accept_count, smtp_accept_queue);
+  
+      /* If a delivery attempt is required, spin off a new process to handle it.
+      If we are not root, we have to re-exec exim unless root can be regained by
+      the use of seteuid. */
+  
+!     if (!local_queue_only && (pid = fork()) == 0)
+        {
+        fclose(smtp_in);
+        fclose(smtp_out);
+--- 390,430 ----
+            ++message_count > smtp_accept_queue_per_connection)
+          {
+          local_queue_only = TRUE;
+!         queue_only_reason = 2;
+          }
+        else if (queue_only_load >= 0)
+          {
+          local_queue_only = (load_average = os_getloadavg()) > queue_only_load;
+!         if (local_queue_only) queue_only_reason = 3;
+          }
+        }
+  
+      /* Log the queueing here, when it will get a message id attached, but
+!     not if queue_only is set (case 0). */
+  
+!     if (local_queue_only) switch(queue_only_reason)
+!       {
+!       case 1:
+!       log_write(4, LOG_MAIN, "no immediate delivery: too many connections "
+!         "(%d, max %d)\n", smtp_accept_count, smtp_accept_queue);
+!       break;
+  
++       case 2:
++       log_write(4, LOG_MAIN, "no immediate delivery: more than %d messages "
++         "received in one connection", smtp_accept_queue_per_connection);
++       break;
++ 
++       case 3:
++       log_write(4, LOG_MAIN, "no immediate delivery: load average was %.2f\n",
++         (double)load_average/1000.0);
++       break;
++       }
++ 
+      /* If a delivery attempt is required, spin off a new process to handle it.
+      If we are not root, we have to re-exec exim unless root can be regained by
+      the use of seteuid. */
+  
+!     else if ((pid = fork()) == 0)
+        {
+        fclose(smtp_in);
+        fclose(smtp_out);
+         
+*** exim-2.05/src/exim.c    Thu Oct  8 11:00:09 1998
+--- src/exim.c	    Wed Oct 14 10:50:25 1998
+***************
+*** 233,238 ****
+--- 235,241 ----
+  int  msg_action = 0;
+  int  msg_action_arg = -1;
+  int  namelen = (argv[0] == NULL)? 0 : (int)strlen(argv[0]);
++ int  queue_only_reason = 0;
+  int  recipients_arg = argc;
+  int  sender_address_domain = 0;
+  int  test_retry_arg = -1;
+***************
+*** 2751,2770 ****
+          ++message_count > smtp_accept_queue_per_connection)
+        {
+        local_queue_only = TRUE;
+!         log_write(4, LOG_MAIN, "no immediate delivery: more than %d messages "
+!           "received in one connection\n", smtp_accept_queue_per_connection);
+        }
+      else if (queue_only_load >= 0)
+        {
+        local_queue_only = (load_average = os_getloadavg()) > queue_only_load;
+!       if (local_queue_only)
+!         log_write(4, LOG_MAIN, "no immediate delivery: load average = %.2f\n",
+!           (double)load_average/1000.0);
+        }
+      }
+  
+!   if (!local_queue_only)
+      {
+      /* If running as root, or if we can regain root by seteuid, or this binary
+      is not setuid to root (an exceptional case) call the delivery function
+      directly for synchronous delivery, or fork a clone of this process to
+--- 2754,2789 ----
+          ++message_count > smtp_accept_queue_per_connection)
+        {
+        local_queue_only = TRUE;
+!       queue_only_reason = 2;
+        }
+      else if (queue_only_load >= 0)
+        {
+        local_queue_only = (load_average = os_getloadavg()) > queue_only_load;
+!       if (local_queue_only) queue_only_reason = 3;
+        }
+      }
+  
+!   /* Log the queueing here, when it will get a message id attached, but
+!   not if queue_only is set (case 0). Case 1 doesn't happen here (too many
+!   connections). */
+! 
+!   if (local_queue_only) switch(queue_only_reason)
+      {
++     case 2:
++     log_write(4, LOG_MAIN, "no immediate delivery: more than %d messages "
++       "received in one connection", smtp_accept_queue_per_connection);
++     break;
++ 
++     case 3:
++     log_write(4, LOG_MAIN, "no immediate delivery: load average was %.2f\n",
++       (double)load_average/1000.0);
++     break;
++     }
++ 
++   /* Else do the delivery */
++ 
++   else
++     {
+      /* If running as root, or if we can regain root by seteuid, or this binary
+      is not setuid to root (an exceptional case) call the delivery function
+      directly for synchronous delivery, or fork a clone of this process to
diff -urN mail/exim.orig/patches/patch-ac mail/exim/patches/patch-ac
--- mail/exim.orig/patches/patch-ac	Mon Oct 19 16:30:09 1998
+++ mail/exim/patches/patch-ac	Mon Oct 19 16:12:33 1998
@@ -0,0 +1,17 @@
+Minor bugfix from author
+
+*** src/transports/smtp.c Thu Oct  8 11:00:12 1998
+--- src/transports/smtp.c   Fri Oct 16 15:08:05 1998
+***************                                                      
+*** 1434,1441 ****
+--- 1434,1443 ----                                            
+        {                                                                   
+        if (host->next != NULL) log_write(0, LOG_MAIN, "%s", message);
+        fprintf(message_log, "%s %s\n", tod_stamp(tod_log), message);
++       /* 
+        for (addr = addrlist; addr != NULL; addr = addr->next)
+          retry_add_item(addr, (addr->local)? "D" : "R", TRUE, NULL, FALSE);
++       */   
+        }
+      }
+    }
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0zVGRw-000455-00>