Menu

#41 Errors under load (try to use poll instead of select)

2.10.3
open
nobody
None
5
2017-11-15
2017-09-13
No

0
down vote
favorite

We're using opendkim with postfix (multi-instance), for signing outgoing mail. At busy moments, opendkim logs the following error:

warning: milter unix:/var/run/opendkim/opendkim.sock: read error in initial handshake
Sep 8 16:00:14 telemann postfix-15/smtpd[24178]: warning: milter unix:/var/run/opendkim/opendkim.sock: can't read SMFIC_OPTNEG reply packet header: Connection reset by peer

And this:

opendkim[14581]: OpenDKIM Filter: accept() returned invalid socket (Numerical result out of range), try again

I understand this can be solved by using using poll() instead of select(), so I've compiled opendkim with --enable-poll, but this does't help.

When stracing the binary, it seems to be still using select:

strace -p 14581
Process 14581 attached
select(6, [5], NULL, [5], {2, 959258}) = 0 (Timeout)
select(6, [5], NULL, [5], {5, 0}) = 0 (Timeout)

How can I check if the binary is using poll? If not, how should I compile opendkim? Or is there another way to solve this?

(I'm not very good at C/C++ unfortunately).

Related

Support Requests: #41

Discussion

  • Dilian Wesselinov Palauzov

    Does compiling libmilter with SM_CONF_POLL before linking it with opendkim help?

    Looking at the code of opendkim the only impact of specifying ./configure --enable-poll is that opendkim -V prints POLL. The last calls within opendkim for poll were removed by commit b6967980bee : Feature request #SF3544764: Support for libar has been discontinued.

    opendkim[14581]: OpenDKIM Filter: accept() returned invalid socket (Numerical result out of range), try again is generated by libmilter and according to my understanding, looking at its source means:

    • "Numerical result out of range" - accept() returned a number higher thant 256, so that at that time probably for some reason the system had allocated more than 265 file descriptors
    • try again - the connection was closed by the milter and the accept() call will be retried (for a new connection)
     

    Last edit: Dilian Wesselinov Palauzov 2017-11-13
    • Stijn van der Ree

      Hi Dilian,

      Thanks, yes, we did it like this (enable polling):

      ./configure --with-odbx --with-openssl=/usr/include/openssl
      --enable-poll --prefix=/opt/opendkim --exec-prefix=/opt/opendkim
      CFLAGS=-g -O2 -w -DFD_SETSIZE=8192 -FD_SETSIZE=8192
      LDFLAGS=-L/home/blah/src/sendmail-xxxx/obj.Linux.3.xxxxxxxx/libmilter/
      -lmilter --with-milter=/home/blah/src/sendmail-xxxxxxx

      Met vriendelijke groet,
      Stijn van der Ree

      --
      Verstuur je nieuwsbrieven met Laposta!
      https://laposta.nl

      On Sun, Nov 12, 2017, at 18:06, Dilian Wesselinov Palauzov wrote:

      Does compiling libmilter with _FFR_WORKERS_POOL before linking it with
      opendkim help?


      ** [support-requests:#41] Errors under load (try to use poll instead of
      select)**

      Status: open
      Group: 2.10.3
      Created: Wed Sep 13, 2017 10:50 AM UTC by Stijn van der Ree
      Last Updated: Wed Sep 13, 2017 10:50 AM UTC
      Owner: nobody

      0
      down vote
      favorite

      We're using opendkim with postfix (multi-instance), for signing outgoing
      mail. At busy moments, opendkim logs the following error:

      warning: milter unix:/var/run/opendkim/opendkim.sock: read error in
      initial handshake
      Sep 8 16:00:14 telemann postfix-15/smtpd[24178]: warning: milter
      unix:/var/run/opendkim/opendkim.sock: can't read SMFIC_OPTNEG reply
      packet header: Connection reset by peer

      And this:

      opendkim[14581]: OpenDKIM Filter: accept() returned invalid socket
      (Numerical result out of range), try again

      I understand this can be solved by using using poll() instead of
      select(), so I've compiled opendkim with --enable-poll, but this does't
      help.

      When stracing the binary, it seems to be still using select:

      strace -p 14581
      Process 14581 attached
      select(6, [5], NULL, [5], {2, 959258}) = 0 (Timeout)
      select(6, [5], NULL, [5], {5, 0}) = 0 (Timeout)

      How can I check if the binary is using poll? If not, how should I compile
      opendkim? Or is there another way to solve this?

      (I'm not very good at C/C++ unfortunately).


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/opendkim/support-requests/41/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Support Requests: #41

  • Dilian Wesselinov Palauzov

    --enable-poll doesn't do anything.

    From your message it is unclear, whether you #define SM_CONF_POLL while you build libmilter and whether this helps, hence the problem is within libmilter using select instead of poll.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.