• odd queue printing delay when sendmail binary compiled with -DUSE_EAI

    From Andreas S. Kerber@21:1/5 to All on Thu Jun 10 14:34:20 2021
    I'm seeing an odd delay in printing the queue, when the
    sendmail binary is compiled with -DUSE_EAI. I wonder whether
    this is to be expected or a possible issue.

    If of interest I can provide a strace or kind of additional
    information.

    Here's a comparision between sendmail binaries with and without -DUSE_EAI showing 1,3sec vs. 0,016sec when printing the empty queue with -bp

    1. with -DUSE_EAI
    [root@frontend1 sendmail-8.17.0.2]# time /usr/sbin/sendmail -bp -C /etc/mail/serverc/sendmail-mx2c.cf
    /var/spool/mqueue-serverc/mx2/df is empty
    Total requests: 0

    real 0m1.349s
    user 0m1.281s
    sys 0m0.022s

    [root@frontend1 sendmail-8.17.0.2]# /usr/sbin/sendmail -d0.1
    Version 8.17.0.2
    Compiled with: ALLOW_255 DNSMAP IPV6_FULL LOG MAP_REGEX MATCHGECOS
    MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX
    NEWDB=5.3 PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
    TLS_VRFY_PER_CTX USERDB USE_EAI XDEBUG


    2. without -DUSE_EAI
    [root@frontend1 sendmail-8.17.0.2]# time /usr/sbin/sendmail -bp -C /etc/mail/serverc/sendmail-mx2c.cf
    /var/spool/mqueue-serverc/mx2/df is empty
    Total requests: 0

    real 0m0.016s
    user 0m0.011s
    sys 0m0.004s


    [root@frontend1 sendmail-8.17.0.2]# /usr/sbin/sendmail -d0.1
    Version 8.17.0.2
    Compiled with: DNSMAP IPV6_FULL LOG MAP_REGEX MATCHGECOS MILTER
    MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX NEWDB=5.3
    PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS TLS_VRFY_PER_CTX
    USERDB XDEBUG

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to Andreas S. Kerber on Thu Jun 10 18:33:08 2021
    Andreas S. Kerber wrote:
    I'm seeing an odd delay in printing the queue, when the
    sendmail binary is compiled with -DUSE_EAI. I wonder whether
    this is to be expected or a possible issue.

    It's not expected and it doesn't happen on systems where I tried it.

    Try the USE_EAI version with SMTPUTF8=false, e.g.,
    time /usr/sbin/sendmail -bp -C /etc/mail/serverc/sendmail-mx2c.cf -O SMTPUTF8=false
    Does that change anything?

    If of interest I can provide a strace or kind of additional
    information.

    Anything that shows where the delay happens would be very useful.

    --
    Note: please read the netiquette before posting. I will almost never
    reply to top-postings which include a full copy of the previous
    article(s) at the end because it's annoying, shows that the poster
    is too lazy to trim his article, and it's wasting the time of all readers.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas S. Kerber@21:1/5 to @esmtp.org on Thu Jun 10 20:32:12 2021
    Claus Assmann <INVALID_NO_CC_REMOVE_IF_YOU_DO_NOT_POST_ml+sendmail(-no-copies-please)@esmtp.org> wrote:
    Try the USE_EAI version with SMTPUTF8=false, e.g.,
    time /usr/sbin/sendmail -bp -C /etc/mail/serverc/sendmail-mx2c.cf -O SMTPUTF8=false
    Does that change anything?

    Setting SMTPUTF8 doesn't change the delay. I think I could narrow it down to an F class macro used in sendmail.cf though.

    F{test}/etc/mail/some-test-file

    I can reproduce it just by filling /etc/mail/some-test-file file with a couple of thousand (unique) values.
    Usually there are about 10k lines in that file. That is causing a delay of about 1s.
    Cutting it down below 2k makes the delay nearly unnoticeable. Going beyond 10 or 20k
    the delay grows quite drastic.

    A sendmail binary without -DUSE_EAI doesn't seem care about how large the
    file is - simply no delay at all :-) Hope this helps to find the culprit.
    It seems important that the lines are unique in order to reproduce the delay.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus =?iso-8859-1?Q?A=DFmann?= @21:1/5 to Andreas S. Kerber on Fri Jun 11 06:13:33 2021
    Andreas S. Kerber wrote:
    I'm seeing an odd delay in printing the queue, when the
    sendmail binary is compiled with -DUSE_EAI. I wonder whether
    this is to be expected or a possible issue.

    Please try this patch:

    diff --git a/sendmail/stab.c b/sendmail/stab.c
    index cf7812ecc..f41320bf4 100644
    --- a/sendmail/stab.c
    +++ b/sendmail/stab.c
    @@ -55,9 +55,7 @@ stab(name, type, op)
    register STAB *s;
    register STAB **ps;
    register int hfunc;
    -#if !USE_EAI
    register char *p;
    -#endif
    int len;

    if (tTd(36, 5))
    @@ -78,10 +76,9 @@ stab(name, type, op)
    hfunc = ((hfunc << 1) ^ ((*cstr) & 0377)) % STABSIZE;
    }
    else
    -#else
    +#endif
    for (p = name; *p != '\0'; p++)
    hfunc = ((hfunc << 1) ^ (SM_LOWER(*p) & 0377)) % STABSIZE; -#endif

    if (tTd(36, 9))
    sm_dprintf("(hfunc=%d) ", hfunc);

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andreas S. Kerber@21:1/5 to @esmtp.org on Fri Jun 11 07:17:38 2021
    Claus Aßmann <INVALID_NO_CC_REMOVE_IF_YOU_DO_NOT_POST_ml+sendmail(-no-copies-please)@esmtp.org> wrote:
    I'm seeing an odd delay in printing the queue, when the
    sendmail binary is compiled with -DUSE_EAI. I wonder whether

    Please try this patch:

    That fixed it, thanks!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)