100% CPU load

Stefan (metze) Metzmacher metze at samba.org
Wed Jan 13 09:28:46 MST 2010


Rusty Russell schrieb:
> On Wed, 13 Jan 2010 03:02:58 am Stefan (metze) Metzmacher wrote:
>> Rusty Russell schrieb:
>> Hi Ronnie,
>>
>>>> I've found another problem with ctdbd spinning
>>>> with 100% CPU load reading 0 bytes from the log child.
>> Here're the fixes for the spinning.
>>
>> The problem were the dup2() call in the wrong direction, which implicit
>> closed the stdout.
>>
>> git pull git://git.samba.org/metze/ctdb/wip.git master-for-ronnie
> 
> Thanks for tracking this down.  I hate to look a gift horse in the mouth,
> but you didn't mention this fix in the git log at all!!
> 
> And there are still issues with this code.  I agree that dup2() in the child
> is simpler, but it was done so we had error handing for the dup2 failing.
> I'd like that back but there's no good way, really: the child can exit, or
> use YA pipe to report failure.
> 
> Also, this function was carefully written to have a valid errno if it failed.
> You cannot call close() without saving errno :(
> 
> Reintroducing the code in ctdb_set_child_logging() seems really weird to me.
> I don't think it adds anything does it?  Setting close on exec is probably
> right though...
> 
> Note: ctdb_set_child_logging should now be called ctdb_set_logging, since
> children have their own separate pipes setup: this captures stdout/stderr from
> the main process for logging, mainly.

I'm happy if you propose some additional (well tested :-) patches.

BTW: why would dup2() every fail?

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100113/66756596/attachment.pgp>


More information about the samba-technical mailing list