[SCM] CTDB repository - branch master updated - ctdb-2.1-47-g1c7adbc

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 9 00:56:26 MDT 2013


On Tue, Apr 09, 2013 at 03:48:45PM +1000, Amitay Isaacs wrote:
> On Mon, Apr 8, 2013 at 5:51 PM, Stefan (metze) Metzmacher
> <metze at samba.org>wrote:
> 
> > Hi Amitay,
> >
> > >     client: Set the socket non-blocking only after connect succeeds
> > >
> > >     If the socket is set non-blocking before connect, then we should
> > catch
> > >     EAGAIN errors and retry. Instead of adding a random number of
> > retries,
> > >     better to wait for connect to succeed and then set the socket to
> > >     non-blocking.
> > >
> > >     Signed-off-by: Amitay Isaacs <amitay at gmail.com>
> >
> > Why have you also moved the set_close_on_exec() call?
> >
> 
> 
> That's an oversight. But after thinking about it, there's no point in
> setting close_on_exec, if connect() is going to fail.  So it does make
> sense to set it after connect has actually succeeded.

Under Linux, there's even SOCK_CLOEXEC as a flag to
socket(2). The point is multi-threaded programs. Not that we
are thread-safe, but I think we should make it as easy as
possible to convert to thread-safety once we decide to go
there.

With best regards,

Volker Lendecke

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list