Hi Brad,
As you said, when the number of bytes actually sent does not match the expected
bytes to send, apr_socket_send() automatically does some setting to force
select/poll on the next write call to handle the incomplete write first.
However, for a TCP request, gmond only poll once, then writes all data to the
socket and close the socket before next poll. So I think we need to resend the
miss part immediately for tcp receive channel. I tested my patch and it works
well for my issue.
Thanks,
Jerry
2009-02-25?23:36:34,"Brad?Nicholes"?<[email protected]> :
>???apr_socket_send()?returns?the?number?of?bytes?sent?in?the?3rd
>parameter.??If?the?number?of?bytes?actually?sent?does?not?match?the
>expected?bytes?to?send,?apr_socket_send()?automatically?sets?the
>apr_sockopt?to?APR_INCOMPLETE_WRITE.??What?that?does?is?force
>select/poll?on?the?next?write?call?to?try?to?handle?the?incomplete?write
>before?actually?writing?any?more?data?to?the?socket.??If?there?is?an
>error?of?some?sort,?the?return?value?from?apr_socket_send()?will
>indicate?a?problem.??However,?I?(or?anybody?else)?should?probably?review
>the?code?in?gmond.c?to?make?sure?that?an?incomplete?write?doesn't
>actually?cause?further?problems?and?that?the?return?value?from
>apr_socket_send()?is?actually?being?handled?correctly.
>
>Brad
>
>
>>>>?On?2/24/2009?at?6:57?PM,?in?message
><[email protected]>,
>Jerry
><[email protected]>?wrote:
>>?Hi,
>>?
>>?Recently,?in?one?of?my?environments,?I?found?"telnet?xxxx?8649"
>didn't?
>>?return?a?well-formed?xml?document.?After?some?checking,?I?found?gmond
>might?
>>?lose?to?send?out?some?characters.?For?example,?I?got?some?xml
>document?like?
>>?"<METRIC?NAME="part_max_used"?VAL="13.8"?TYPE="float"?UNITS="%"
>TN="55"?
>>?TMAX="180"?<EXTRA_DATA>".
>>?
>>?After?read?the?code,?I?think?usage?of?"apr_socket_send"?in?"gmond.c"
>has?
>>?defect.?We?just?check?return?value?of?"apr_socket_send"?but?do?NOT
>check?how?
>>?many?characters?have?been?sent.?I?gave?a?patch?in?attachment.?FYI
>>?
>>?Thanks,
>>?
>>?Jerry
>>?
>>?
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Ganglia-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ganglia-developers