>>> On 9/18/2007 at 10:02 PM, in message
<[EMAIL PROTECTED]>, Mike Walker
<[EMAIL PROTECTED]> wrote:
> Only speaking for what is happening on OSX.
> 
> The original issue (before the patches):
> After reading all the data from the for(;;) loop, we would read a  
> SYS_CALL buffer, determine that POLLUP was set and throw out the  
> entire message when we set d->dead=1 and did a "goto take_a_break;
> 
> Thus we where not getting any indication of an error, just gmetad  
> would not work correctly on OSX.
> 
> 
> With the RC release with the patch:
> A) As we go into the if (struct_poll.revents & POLLIN) and do a  
> SYS_CALL on 1023 bytes, we get back X bytes_read.
> B) Then doing a 'if' on POLLHUP, we find that POLLHUP is set and  
> would normally just do a 'break' which would take us out of the for 
> (;;) loop and attempt to process the XML data.  However, with this  
> patch we get XML parser errors, and thus throwing out the incomplete  
> messages.   (Warning occurs when running in debug mode, and still the  
> gmetad not working correctly on OSX.)
> 
> To test the theory:
> However, IF we do another SYS_CALL for another 1023 bytes AFTER the  
> check for POLLHUP (and before the 'break;')   there is an additional  
> Y bytes read from the system socket buffer.  Thus, most of the time,  
> we never receive the entire message before we hit the POLLHUP break,  
> and thus loose the entire message.
> 
> I have only done code inspection of the OSX kernel (haven't compiled  
> the kernel in debug), but it  "Appears" to set POLLHUP,  Not on the  
> test when the application is done reading (as this 'if' statement  
> represents) or a lost connection as suggested in the standard, but  
> some other time way before we are done reading valid data off the  
> socket buffer.
> 
> Thus, at this point, I would not even attempt to test for POLLHUP on  
> OSX at this point.
> 
> Did that explain what we are seeing on OSX?
> 

Wow, this is the scenario that I was afraid of.  I am by no means an expert in 
this area, but this seems broken on OSX.  In this case you are correct, POLLHUP 
really means nothing.  Your original patch is probably the way to go.

Brad


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ganglia-developers mailing list
Ganglia-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-developers

Reply via email to