Please report new issues athttps://github.com/DOCGroup
If a client uses AMI to make an asynchronous call to a collocated server, with collocation optimisations enabled, the call is in fact made synchronously (ie within the call to sendc_foo, the servant's foo method is called). There are a number of issues with this: 1. It's Just Wrong. The semantics of AMI require asynchronous invocation, and any optimisation for collocated objects isn't allowed to change that. The handler function is not called as required. 2. It can't work, because the signatures of foo and sendc_foo are usually different (sendc_foo always returns void and omits out parameters). In my testing with a function returning long I saw stack corruption, because the long result was written to the void retval of the sendc function. 3. Exceptions don't work either - if the server throws a user exception then it is thrown directly from sendc_foo (which is forbidden by the spec) and the _excep function is not invoked. A test program to demonstrate this is fairly easy, but I don't currently have a standalone one. I'll see if I can produce a stripped down test harness. Note that disabling collocation (-ORBcollocation no) is not a full workaround for this, since it breaks AMI exception handling - see bug 2350.
adding myself to the cc list
Changed component to AMI
Accept, this is valid. Calling the servant on another thread is at this moment seen as an extension we don't support. For doing this the data has to be marshalled/demarshalled but maybe we can reuse the CSD argument cloning
changing this to enhancement
added depends on
we would need something like -ORBAMICollocation yes|no that would indicate when AMI is used whether collocation is allowed or not
reassign
updated version and accept
added cc
Fri Apr 20 08:05:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * tao/ORB_Core.cpp: * tao/ORB_Core.h: * tao/params.cpp: * tao/params.h: * tao/params.inl: Added a new -ORBAMICollication which is default yes. If this is no, then when a collocated AMI invocation is made, the call is converted to a remote call so that another thread can handle the servant. Also the problems with argument corruption are then gone. This is for bugzilla 2351.
this is fixed