You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Alex Mantaut (JIRA)" <ji...@apache.org> on 2012/08/13 21:12:38 UTC

[jira] [Commented] (AXIS2C-1551) Crash when reusing svc_client with non-blocking call

    [ https://issues.apache.org/jira/browse/AXIS2C-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13433436#comment-13433436 ] 

Alex Mantaut commented on AXIS2C-1551:
--------------------------------------

Perhaps the patch posted in https://issues.apache.org/jira/browse/AXIS2C-1584 fixes this bug?
                
> Crash when reusing svc_client with non-blocking call
> ----------------------------------------------------
>
>                 Key: AXIS2C-1551
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1551
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: core/clientapi
>    Affects Versions: 1.6.0
>         Environment: windows
>            Reporter: Leo Wang
>            Priority: Critical
>              Labels: non-blocking, reuse
>
> I have an issue when I try using non-blocking axis2/c call to access a web service. Please help me.
> The pseudo code is as follow,
> Firstly, start a web request as follow,
>       axis2_callback_t *callback = axis2_callback_create(env); 
>       axis2_callback_set_on_complete(callback, callback_on_complete);
>       axis2_callback_set_on_error(callback, callback_on_error);
>       axis2_svc_client_send_receive_non_blocking(svc_client, env, the_1st_request, callback);
> In callback_on_complete, I try let the same svc_client to send out the 2nd request,
>       axis2_callback_t *callback = axis2_callback_create(env); 
>       axis2_callback_set_on_complete(callback, callback_on_complete);
>       axis2_callback_set_on_error(callback, callback_on_error);
>       axis2_svc_client_send_receive_non_blocking(svc_client, env, the_2nd_request, callback);
> The problem is, the 2nd non-blocking call makes the process crash.
> I debugged into the code; It seems send_receive_non_blocking puts the corresponding blocking method to thread pool, and the thread sent the request and get the response, the callback_on_complete get executed. Unfortunately, the thread doesn't exit immediately, it try to free something;
> if (args_list->callback)
> {
>         axis2_callback_invoke_on_complete(args_list->callback,
>                                           th_env,
>                                           args_list->op_client->async_result);
>  
>         axis2_callback_set_complete(args_list->callback, th_env, AXIS2_TRUE);
> }
>  
>     /* Clean up memory */
> axis2_async_result_free(args_list->op_client->async_result, th_env);
> But the 2nd thread, started by axis2_svc_client_send_receive_non_blocking in callback_on_complete, has freed the op_client before the 1st thread tries freeing op_client->async_result.
> Please tell me how to check if one non-blocking call is completely done. I mean, the svc_client is ready for reusing or deleting. It seems callback_on_complete is not the answer.
> BTW, Why my program works this way, is because it need upload some huge data to server with SOAP/MTOM, the data has to be split into multiple packages; otherwise one failure could make the resending data cost too much.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org