[PATCH] s3:events: Call all ready fd event handlers on eachiteration of the main loop

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Sep 16 22:48:48 MDT 2010


On Thu, Sep 16, 2010 at 02:10:47PM -0700, Steven Danneman wrote:
> Taking the design considerations you mentioned I've reworked my patch.
> It is not the Cadillac solution, as it only handles the smbd/select
> case, but I went for minimal code disruption.
> 
> This patch effectively changes the select loop in smbd child process
> only, to safely iterate through all fds returned by select each time,
> while still handling timed and signal events round-robin.
> 
> This passes make test and I'm throwing more intensive work loads at it
> now to test it's stability.
> 
> I've also opened bug 7686 to track this issue.  Please tell me what you
> think.

I think that actually does it. The most important piece is
that we start walking the fde list new after each handler
was called. The crash that was fixed was due to one socket
event triggering a TALLOC_FREE on a different fde. It was in
winbind: accept() on the listener socket triggered an idle
client to be thrown out, thus its fde would vanish. (iirc...)
This meant that the linked list had changed under our feet.

While I have not tested it, I think that it can go in. A
heavily loaded winbind will probably pretty quickly show
this problem again. If you push it, can you also push a
revert of d5cf6482ed0cd, so that it will not confuse
anybody?

Thanks!

Volker

P.S: Would the commit message also qualify as a source code
comment? :-)


More information about the samba-technical mailing list