- gras_msg_wait_ext(ctx->timeout,
- ctx->msgtype, NULL, msgfilter_rpcID, &ctx->ID,
- &received);
+ TRY {
+ /* The filter returns 1 when we eat an old RPC answer to something canceled */
+ do {
+ gras_msg_wait_ext(ctx->timeout,
+ ctx->msgtype, NULL, msgfilter_rpcID, &ctx->ID,
+ &received);
+ } while (received.ID != ctx->ID);
+
+ } CATCH(e) {
+ if (!_gras_rpc_cancelled)
+ _gras_rpc_cancelled = xbt_dynar_new(sizeof(ctx),NULL);
+ xbt_dynar_push(_gras_rpc_cancelled,&ctx);
+ INFO2("canceled RPC %ld pushed onto the stack (%s)",ctx->ID,ctx->msgtype->name);
+ RETHROW;
+ }
+