Samisa Abeysinghe wrote:
> Ryzhov, Evgeny wrote:
>> Hi colleagues,
>>
>> -1-
>> I tried to reuse client but determined that multiple invocations
>> followed with memory leaks(about 300k per call) and unclosed sockets.
>> You can see this on the following test:
>> 1) run axis_http_server.exe
>> 2) run echooo.exe (source echooo.c is applyed)
>> 3) watch out for sockets state before and after sending echo(there
>> will be sockets in CLOSE_WAIT and FIN_WAIT_2 states)
>> 4) watch out for memory usage on client and server sides
>>
> Memory leaks is a known issue. Even 0.93 would have considerable
> amount of leaks. Given the amount of cycles the current developer base
> has, it is expected that it would only be possible to fix leaks
> leading towards 1.0.
>> -2-
>> I explored process of socket shutdown in network_handler.c and
>> determind that
>> axis2_network_handler_close_socket function returns only after 2 minutes
>> You can see this on the following test:
>> 1) modify axis2_network_handler_close_socket function in
>> network_handler.c as shown below:
>> ---
>> AXIS2_EXTERN axis2_status_t AXIS2_CALL
>> axis2_network_handler_close_socket (const axis2_env_t *env,
>> axis2_socket_t socket)
>> {
>> int i = 0;
>> char buf[32];
>> AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
>> if(socket < 0)
>> {
>> AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SOCKET,
>> AXIS2_FAILURE);
>> return AXIS2_FAILURE;
>> }
>> shutdown(socket, AXIS2_SHUT_WR);
>> axis2_network_handler_set_sock_option(env, socket, SO_RCVTIMEO, 1);
>> AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
>> "\n[axis2_network_handler_close_socket, before recv, i=%ld]", i);
>> i = recv(socket, buf, 32, 0);
>> AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
>> "\n[axis2_network_handler_close_socket, after recv, i=%ld]", i);
>> AXIS2_CLOSE_SOCKET(socket);
>> return AXIS2_SUCCESS;
>> }
>> ---
>> 2) recompile ( make axis2_util ) and copy axis2_util.dll to Axis2 libdir
>> 3) run axis_http_server.exe with loglevel 4
>> 4) run echooo.exe (source echooo.c is applyed) and wait more then 2
>> minutes before exit
>> 5) watch over axis2.log
>>
> What do you deem the reason would be? If I remember correct, there was
> this problem with the Java client, which lead to the decision to
> introduce a timeout. However 2 minutes is too long, there must be some
> constant in the system causing this IMHO, which needs to be found and
> fixed.
> Please raise a Jira on this.
I believe the problem occurs only in the windows platform because in
other (Linux and Unix) systems, socket obeys the
axis2_network_handler_set_sock_option(env, socket, SO_RCVTIMEO, 1) call
and sets the receive time out to 1 ms. So ideally recv(socket, buf, 32,
0) command should only spend 1ms maximum, but I am not sure how Windows
behaves with socket timeout setting. Can some one working in Windows
platform look into this ? If we can't fix the timeout setting option we
need to change the above piece of code (may be we can remove the recv
function and try out). IIRC, removing this will work perfectly with
axis2c client/server scenario, but may cause problems in interop'ing
with Java client/server.
-sahan
>> -3-
>> Is it possible to reuse svc_client, or it's neccessary to recreate ones?
>> I tryed to invoke service twice in echo.c:
>> ret_node1 = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
>> ret_node2 = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
>> but client crashes in this case.
>> I think, it will be very useful to provide an example with multiple
>> service invocation.
>>
> Ideally we should be able to reuse, that is the idea. However I have
> not tried this. There was a complain on this earlier also, when one
> wanted to use service client from within a service. Not sure if there
> is a Jira on this. Please raise a Jira on this as well. My take is
> that it is due to the AXIOM handling problems that this happens.
> Anyway it would be much useful if you could send in the debugger trace
> for the crash.
>
> Yes I agree that we should have a sample on multiple service invocation.
>
> Thanks,
> Samisa...
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]