Hi,

When I raise a ForwardRequest exception in a receive_exception point, which 
receives
a COMM_FAILURE exception, the orb doesn't retry the request. This 
ForwardRequest 
exception reaches my main(). But, when I make this test on the server-side, 
Mico retry 
the request.

I believe that Mico should retry the request on the client-side. Am I right ?

However, I wrote a patch for Mico 2.3.13:

--- static.cc    2010-07-19 16:54:10.000000000 -0300
+++ static.cc.JUL2010    2010-07-19 16:52:59.000000000 -0300
@@ -2252,6 +2252,7 @@
        break;

    case CORBA::InvokeSysEx:
+        try {
        // receive_exception (system exception)
        PInterceptor::PI::_receive_exception_ip
        (_cri, PortableInterceptor::SYSTEM_EXCEPTION,
@@ -2292,6 +2293,22 @@
                     break;
        }
        }
+        } catch(PortableInterceptor::ForwardRequest_catch& exc) {
+            _obj->_forward(exc->forward);
+            env()->clear();
+            CORBA::release(_cri);
+            if (_id != NULL)
+            delete _id;
+            _id = orb->new_orbid();
+            _cri = PInterceptor::PI::_create_cri(_obj, _opname);
+            PInterceptor::PI::_send_request_ip
+            (_cri, CORBA::ORB::get_msgid(_id), _args, this->ctx_list(),
+             this->ctx(), this->context());
+            _id = orb->invoke_async (_obj, this, Principal::_nil(),
+                 TRUE, 0, _id);  
+              done = TRUE;
+             break;          
+        }
        done = TRUE;
        break;

@@ -2489,6 +2506,7 @@
        break;

    case CORBA::InvokeSysEx:
+        try{
        PInterceptor::PI::_receive_exception_ip
        (_cri, PortableInterceptor::SYSTEM_EXCEPTION,
         this->exception(), this->ctx_list(),
@@ -2532,6 +2550,20 @@
                     break;
        }
        }
+        } catch(PortableInterceptor::ForwardRequest_catch& exc) {
+            _obj->_forward(exc->forward);
+            env()->clear();
+            CORBA::release(_cri);
+            if (_id != NULL)
+            delete _id;
+            _id = orb->new_orbid();
+            _cri = PInterceptor::PI::_create_cri(_obj, _opname);
+            PInterceptor::PI::_send_request_ip
+            (_cri, CORBA::ORB::get_msgid(_id), _args, this->ctx_list(),
+             this->ctx(), this->context());
+            _id = orb->invoke_async (_obj, this, Principal::_nil(),
+                 TRUE, 0, _id);            
+        }
        done = TRUE;
        break;







--- pi_impl.cc    2010-07-19 16:54:58.000000000 -0300
+++ pi_impl.cc.JUL2010    2010-07-19 16:52:49.000000000 -0300
@@ -2137,15 +2137,15 @@
    PInterceptor::PI::_exec_receive_exception(ri);
    throw;
     } catch (PortableInterceptor::ForwardRequest_catch& ex) {
-    ClientRequestInfo_impl* ri_impl
-        = dynamic_cast<ClientRequestInfo_impl*>(ri);
-    assert(!CORBA::is_nil(ri_impl));
-    ri_impl->exception(ex->_clone());
-    ri_impl->effective_target(ex->forward);
-    ri_impl->reply_status(PortableInterceptor::LOCATION_FORWARD);
-    ri_impl->icept_oper(PInterceptor::RECEIVE_OTHER);
-    PInterceptor::PI::_exec_receive_other(ri);
-    throw;
+    ClientRequestInfo_impl* ri_impl
+        = dynamic_cast<ClientRequestInfo_impl*>(ri);
+    assert(!CORBA::is_nil(ri_impl));
+    ri_impl->exception(ex->_clone());
+    ri_impl->effective_target(ex->forward);
+    ri_impl->reply_status(PortableInterceptor::LOCATION_FORWARD);
+    ri_impl->icept_oper(PInterceptor::RECEIVE_OTHER);
+    PInterceptor::PI::_exec_receive_other(ri);
+    throw;
     } catch (CORBA::UserException& ex) {
    PInterceptor::ClientRequestInfo_impl* ri_impl
        = dynamic_cast<PInterceptor::ClientRequestInfo_impl*>(ri);
@@ -2255,7 +2255,12 @@
    cri->icept_oper(PInterceptor::RECEIVE_EXCEPTION);
    cri->exception(exception->_clone());
    cri->set_reply_service_context_list(reply_scl);
+    try {
    PInterceptor::PI::_exec_receive_exception(cri); // end point
+    } catch (PortableInterceptor::ForwardRequest_catch& ex) {
+        std::cout << "receive_exception_ip: catch ForwardException" << endl;
+        throw;
+    }
     }
}

@@ -2276,7 +2281,11 @@
    cri->contexts(contexts);
    cri->operation_context(operation_context);
    cri->set_reply_service_context_list(reply_scl);
+    try {
    PInterceptor::PI::_exec_receive_exception(cri); // end point
+    } catch (PortableInterceptor::ForwardRequest_catch& ex) {
+        throw;
+    }
     }
}


Ricardo Cosme


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mico-devel mailing list
Mico-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mico-devel

Reply via email to