Aaron Stone wrote:
> The current fix is very minimal, and I believe it does the trick. But
> looking into it some more, I think we can make a slightly broader change
> that has the same effect but with fewer calls to fcntl...

agree.

> We should check to see if the listen sockets inherit blocking state
> after fork(). I would assume that this is the case, but I don't know for
> a fact. If so, then we don't have to do any dance at all, and can indeed
> simply mark the listen sockets as non-blocking in the parent.

We can't assume the state is inherited. But I've done all this, and
committed the patch.

> 
> A test harness should open a *lot* of new connections and immediately
> drop them so that we can try to wedge the process at accept() and then
> see what code changes prevent that. The test case I have in mind is to
> start up a dbmail daemon with two listen ip's. Then we open and drop a
> few thousand connections on one ip, then see if any processes are still
> listening to another ip.


This is what I use:
--------------------------------
#!/bin/bash

imapserver="${1:-localhost}"

function hitimap()
{
        i=0
        while [ $i -lt 30 ]; do
                (timeout 10 nc $imapserver imap &>/dev/null &)
                let i=$i+1
        done
}

while [ 1 ]; do
        hitimap
        sleep 20
done
--------------------------------


-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl

Reply via email to