axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Wang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AXIS2C-1551) Crash when reusing svc_client with non-blocking call
Date Wed, 29 Jun 2011 09:29:29 GMT

     [ https://issues.apache.org/jira/browse/AXIS2C-1551?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Leo Wang updated AXIS2C-1551:
-----------------------------

    Description: 
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.


  was:
;  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, when 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.



> 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.
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


Mime
View raw message