On Wed, Sep 12, 2007 at 09:35:27PM +0100, Alex Kiernan wrote: > I made these changes earlier today - its been running for ~6 hours > now, answered 5.3M queries and still hasn't hung:
Cool! This is a variation on http://wiki.powerdns.com/cgi-bin/trac.fcgi/changeset/1059 The more general fix is to include a line that makes sure we don't trust numevents unless ret >=0. I hope to hear from you regarding the gettimeofday thing, and if this was not relevant as expected. Many thanks Alex! Bert > > Index: portsmplexer.cc > =================================================================== > RCS file: /cvsroot/upstream/pdns-recursor/portsmplexer.cc,v > retrieving revision 1.1.1.1 > diff -u -r1.1.1.1 portsmplexer.cc > --- portsmplexer.cc 12 Nov 2006 16:56:13 -0000 1.1.1.1 > +++ portsmplexer.cc 12 Sep 2007 20:29:12 -0000 > @@ -89,14 +89,14 @@ > unsigned int numevents=1; > int ret= port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, > s_maxevents), &numevents, &timeout); > > - gettimeofday(now,0); > - > if(ret < 0 && errno!=EINTR && errno!=ETIME) > throw FDMultiplexerException("completion port_getn returned > error: "+stringerror()); > > - if((ret < 0 && errno==ETIME) || numevents==0) // nothing > + if((ret < 0 && errno==EINTR) || numevents==0) // nothing > return 0; > > + gettimeofday(now,0); > + > d_inrun=true; > > for(unsigned int n=0; n < numevents; ++n) { > > The gettimeofday move is clearly wrong as it changes the API (I moved > it just in case it was stamping on errno). The other one I think is > the significant one - if we get EINTR, we want to do nothing and go > back around the event loop, if we get ETIME then numevents is valid > (and presumably could be 1), if my reading of the man pages is correct > (and some brief inspection of the source behind it). It also seems to > match better what the other mplexer implementations do. > > I'm going to put the gettimeofday call back where it was and start > running tests again. > > -- > Alex Kiernan > _______________________________________________ > Pdns-users mailing list > Pdns-users@mailman.powerdns.com > http://mailman.powerdns.com/mailman/listinfo/pdns-users > > > !DSPAM:46e84daf218341188220721! -- http://www.PowerDNS.com Open source, database driven DNS Software http://netherlabs.nl Open and Closed source services _______________________________________________ Pdns-users mailing list Pdns-users@mailman.powerdns.com http://mailman.powerdns.com/mailman/listinfo/pdns-users