Hi,
What can cause a gsoap client function to never return even though all timeouts
are set to 180 seconds?
I am investigating a customer reported bug in a legacy product that uses gsoap
2.7.0f. It happens in a client daemon running on CentOS (kernel 2.4.21-37.EL).
I need help on how to proceed. What are the common causes of such a problem?
Restarting the client is the only known fix but that is not ideal.
The client randomly gets stuck in a generated gsoap function to upload data.
The function never returns, even though all timeouts are set to 180 seconds. It
happens randomly after 1000-5000 iterations. The CPU does not spike, and all
other unrelated threads continue working fine, so it appears to be a waiting
for something??? Timeouts have been tested, so it may only be happening under
stress like long running, heavy load, high latency, other conditions???
I am hoping this will jog someone's memory. Maybe it is already fixed in a
newer release. I saw a 2.7.0f patch for a server-side connect problem that
sounds similar, but my problem happens in the client-side. Could it be the same
problem? I could not find any other information on that original bug report.
I can post more details if necessary. The client connects to the server using
SSL port 443. The code is compiled with the following flags:
-D__LINUX__ -D__i686__ -DSOCKET_DEBUG -DWITH_NONAMESPACES -DWITH_OPENSSL
I put log messages before and after the call. See below. When the problem
happens the second log message never gets printed. No CPU spike implies to me
it gets stuck waiting for something.
log->LogLine(3, "Constructed gsoap message. Sending data...");
int rc = soap_call_ns1__Task_x002eSubmit(...);
log->LogLine(3, "Finished sending data. Return code = %i.", rc);
Here is the generated gsoap code for the call if that helps...
SOAP_FMAC5 int SOAP_FMAC6 soap_call_ns1__Task_x002eSubmit(struct soap *soap,
const char *URL, const char *action, int _SessionID,
ArrayOf_USCOREtns1_USCORET_USCOREData *_DataArray, struct
ns1__Task_x002eSubmitResponse ¶m_31) {
struct ns1__Task_x002eSubmit soap_tmp_ns1__Task_x002eSubmit;
soap->encodingStyle = "http://schemas.xmlsoap.org/soap/encoding/";
if (!URL)
URL = "http://127.0.0.1:8080/dms/services/ServerMMS";
if (!action)
action = "";
soap_tmp_ns1__Task_x002eSubmit._SessionID=_SessionID;
soap_tmp_ns1__Task_x002eSubmit._DataArray=_DataArray;
soap_begin(soap);
soap_serializeheader(soap);
soap_serialize_ns1__Task_x002eSubmit(soap,
&soap_tmp_ns1__Task_x002eSubmit);
soap_begin_count(soap);
if (soap->mode & SOAP_IO_LENGTH)
{ soap_envelope_begin_out(soap);
soap_putheader(soap);
soap_body_begin_out(soap);
soap_put_ns1__Task_x002eSubmit(soap,
&soap_tmp_ns1__Task_x002eSubmit, "ns1:Task.Submit", "");
soap_body_end_out(soap);
soap_envelope_end_out(soap);
}
if (soap_connect(soap, URL, action)
|| soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| soap_put_ns1__Task_x002eSubmit(soap,
&soap_tmp_ns1__Task_x002eSubmit, "ns1:Task.Submit", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap)
|| soap_end_send(soap))
return soap_closesock(soap);
soap_default_ns1__Task_x002eSubmitResponse(soap, ¶m_31);
if (soap_begin_recv(soap)
|| soap_envelope_begin_in(soap)
|| soap_recv_header(soap)
|| soap_body_begin_in(soap))
return soap_closesock(soap);
soap_get_ns1__Task_x002eSubmitResponse(soap, ¶m_31,
"ns1:Task.SubmitResponse", "");
if (soap->error)
{ if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
return soap_recv_fault(soap);
return soap_closesock(soap);
}
if (soap_body_end_in(soap)
|| soap_envelope_end_in(soap)
#ifndef WITH_LEANER
|| soap_resolve_attachments(soap)
#endif
|| soap_end_recv(soap))
return soap_closesock(soap);
return soap_closesock(soap);
}
Thanks in advance for any help you can provide.
Justin