[omniORB] Oneway calls not working on local execution

Michael Teske subscribe at teskor.de
Tue Dec 8 14:08:21 UTC 2020


Hi Tomas,

if the call goes across the network, one can just send the request and not wait for a result, so a oneway doesn't wait.
But corba calls for local objects result in a normal function call. I don't think that there is any exception for 
oneways. To achieve that one would have to route the local request across the network, e.g. the loopback interface, and 
I'd say in most cases this would not be wanted. Maybe it's possible to convert a local object to an object reference on 
the network which would do exactly that, when called. But if you already know your object is local you could start a 
thread for the call yourself, circumventing any CORBA overhead. Can't think of any "automatic" solution right now, but 
maybe Duncan has an idea :)

Greetings,
   Michael

Am 30/11/2020 um 20:04 schrieb Tomas Staig via omniORB-list:
> Dear all,
>     we use omniORBpy for a long time now, but just recently we noticed a problem with oneway operations when both the 
> client and the servant are on the same process. We have a container/component model on top of CORBA, so we don't impose 
> restrictions on the deployment of the CORBA objects, which means this situation can happen depending on the developers 
> and the people doing the deployment.
> 
> I made an isolated test using omniORBpy that exposes the situation:
> #ifndef _ASYNC_MODULE_IDL_
> #define _ASYNC_MODULE_IDL_
> 
> #pragma prefix "acsws"
> 
> module AsyncModule
> {
>      interface AsyncExample {
>          oneway void delay(in long sleepSec);
>      };
> };
> #endif
> 
> Then, the implementation would be:
> import sys
> import time
> import datetime
> 
> import AsyncModule
> import AsyncModule__POA
> 
> from omniORB import CORBA, PortableServer
> 
> class AsyncExampleImpl(AsyncModule__POA.AsyncExample):
>      def delay(self, sleepSec):
>          print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), "Start")
>          time.sleep(sleepSec)
>          print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), "Finish")
> 
> orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
> poa = orb.resolve_initial_references("RootPOA")
> 
> servant = AsyncExampleImpl()
> obj = servant._this()
> 
> poaManager = poa._get_the_POAManager()
> poaManager.activate()
> 
> print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), "Before")
> result  = obj.delay(2)
> print(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"), "After")
> 
> The output I receive is the following:
> 2020-11-30 19:00:38.022027 Before
> 2020-11-30 19:00:38.022068 Start
> 2020-11-30 19:00:40.023909 Finish
> 2020-11-30 19:00:40.024071 After
> 
> Which shows that the process remained waiting for the oneway operation to finish before continuing.
> 
> When splitting this in two processes (client and server), the output is the following:
> 2020-11-30 19:02:13.797152 Before
> 2020-11-30 19:02:13.797635 After
> 2020-11-30 19:02:13.797742 Start
> 2020-11-30 19:02:15.800049 Finish
> 
> Which is what I would expect from a oneway operation.
> 
> Thanks a lot!
> 
> Best regards,
> Tomas.
> 
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> https://www.omniorb-support.com/mailman/listinfo/omniorb-list
> 




More information about the omniORB-list mailing list