[Ace-users] [tao-bugs] Bug in MT_NOUPCALL prevents upcall disabling
hancock at sedsystems.ca
Mon Feb 25 15:21:27 CST 2008
Back in 2005, Mickael P. Golovin pointed out a problem in the
LF_NOUPCALL client connection handler, where it failed to disable
upcalls in some cases:
Looking at the current code it appears that this fix is still needed.
With the current code, upcalls are only disabled if the transport was
opened in the client role and is not bidirectional. However in this case
upcalls on that connection are not even possible so this makes no sense.
Previously the upcalls were disabled if the transport was opened in the
server role or is bidirectional, which makes more sense.
The code was originally correct but was broken by the change below.
Sun Oct 3 13:38:01 2004 Balachandran Natarajan <bala at dre.vanderbilt.edu>
Added a new pure virtual method, can_process_upcalls ().
Implementation for can_process_upcalls (). This method returns
true for all the Wait strategies but for
Wait_On_LF_No_Upcall. Only the Wait_On_LF_No_Upcall returns
false since the semantics of the class are so.
Use the can_process_upcalls () in handle_input_eh () instead of
the checks in place there. This check invariably resulted in a
TSS access which seem to slow down things quite a bit. This was
based on my profiler. I am not sure whether this is going to
show up any conclusive results in our stat pages.
Removed the acts_as_server () call since the functionality is
replaced by the new pure virtual method in Wait_Strategy.
I've made a patch based on their suggested fix, it's below. It seems
like this fix should be applied as otherwise MT_NOUPCALL will basically
not work at all..
--- ACE_wrappers/TAO/tao/Wait_On_LF_No_Upcall.cpp.orig 2008-02-25
+++ ACE_wrappers/TAO/tao/Wait_On_LF_No_Upcall.cpp 2008-02-25
@@ -96,13 +96,15 @@ namespace TAO
Wait_On_LF_No_Upcall::can_process_upcalls (void) const
- TAO_ORB_Core_TSS_Resources *tss =
- this->transport_->orb_core ()->get_tss_resources ();
+ if ((this->transport_->opened_as () == TAO::TAO_SERVER_ROLE) ||
+ (this->transport_->bidirectional_flag () == 1))
+ TAO_ORB_Core_TSS_Resources *tss =
+ this->transport_->orb_core ()->get_tss_resources ();
- if ((this->transport_->opened_as () == TAO::TAO_CLIENT_ROLE) &&
- (this->transport_->bidirectional_flag () == 0) &&
- (tss->upcalls_temporarily_suspended_on_this_thread_ == true))
- return false;
+ if (tss->upcalls_temporarily_suspended_on_this_thread_ == true)
+ return false;
Email: hancock at sedsystems.ca
More information about the Ace-users