[ntp:bugs] [Bug 596] ntpd dies after 2 days

bugzilla at ntp.isc.org bugzilla at ntp.isc.org
Mon Apr 17 02:07:07 UTC 2006


http://bugs.ntp.isc.org/show_bug.cgi?id=596



----------------------------------------------------------------------------
Additional Comments From mayer at ntp.org (Danny Mayer)
Submitted on 2006-04-17 02:07
>> Just to be clear, the full_recvbuffs() function is not thread-safe as it does
>> not take out a lock before returning the value.
> 
> It does not need to take out a lock to read the value.

Normally it is true but the purpose it was being used for was not.

>> By contrast the get_full_recv_buffer() is thread safe as it takes out
>> a lock first before removing the buffer from the list. There's too
>> much overhead to use the locks just to return the value.
> 
> You are, IMO, incorrectly mixing things together here.  We want the "Is
> there more to do" question to be answered quickly and easily.  That is
> separate from the "do some work" question.

Not at all. You leave that to the get_full_recv_buffer() for that. It had
already decided that there was something to do otherwise you wouldn't have
gotten to the while loop in the first place.

> And while I have not seen your new patch, your old one seemed
> incomplete in that it left comments in the code that are wrong after
> your patch, and it left code in place that you argue is broken.

I can fix the comments. It was put together in a hurry.

> There are several other places in the loop in ntpd.c that check
> full_recvbuffs().

Yes, but once you've decided that there's something to process you don't need to
check again.

> 
> I believe there are 2 issues going on here, one a thread issue with
> windows, and a signalled IO issue with *IX.
> 

Yes,l that's why I separated this from #527.

> For Windows, we need to be sure we have LOCK/UNLOCK calls in the right
> places.
> 
> For the appropriate *IX systems, we need BLOCKIO/UNBLOCKIO calls in the
> right places.
> 

Already done.

Danny

-- 
Danny Mayer <mayer at ntp.org>



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


More information about the bugs mailing list