diff options
author | bala <balanatarajan@users.noreply.github.com> | 2002-11-21 18:31:56 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2002-11-21 18:31:56 +0000 |
commit | ca8719d1ac5cd5d8808c5819440c706270c6caa1 (patch) | |
tree | b0d9e7e40b4e462ab8f877ecf84a72bff482b826 | |
parent | 18cde3c5076ed27de054cd76abc3330cee66ed49 (diff) | |
download | ATCD-ca8719d1ac5cd5d8808c5819440c706270c6caa1.tar.gz |
ChangeLogTag: Thu Nov 21 13:26:27 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 9 | ||||
-rw-r--r-- | TAO/tao/Connection_Handler.cpp | 149 |
2 files changed, 85 insertions, 73 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index e95591cdccf..7019976b539 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Thu Nov 21 13:26:27 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Connection_Handler.cpp: Avoid checks for reactor consistency + if the handler is not registered with the reactor. This shuld + fix most of the runtime problems that we are seeing. This place + needs to be reexamined after the beta. The interscetion of + RTCORBA and nonRT cases simplyy makes this place too + complicated. + Wed Nov 20 18:04:00 2002 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> * tests/Muxing/run_test.pl: Checked in a version of the script diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index c5fd387b8ea..e304818b7d2 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -403,82 +403,85 @@ TAO_Connection_Handler::close_connection_eh (ACE_Event_Handler * eh) } this->transport ()->purge_entry (); - - ACE_Reactor * eh_reactor = eh->reactor (); - - // These checks are valid as long as the ORB_Core is not - // shutdown. It is good to have these checks and they are valid - // for most of the cases. Please see below for exceptions - if (this->orb_core_->has_shutdown () == 0) - { - // The exception when these are not valid is for RTCORBA. With - // RTCORBA on, you can threads in different lanes creating - // handlers and registering them with reactor in those - // respective lanes. These threads could then even go away - // leaving the task of reclaiming these resources to the main - // thread. For the main thread that takes the responsibility - // of finalizing () the lanes and the pools, the calls and - // comparison make no sense. - ACE_Reactor * reactor = - this->transport()->orb_core()->reactor (); - ACE_ASSERT (eh_reactor == 0 || eh_reactor == reactor); - - ACE_Reactor * orb_core_reactor = this->orb_core_->reactor (); - ACE_ASSERT (reactor == orb_core_reactor); - - if (eh_reactor == 0) - eh_reactor = reactor; - - ACE_UNUSED_ARG (orb_core_reactor); - ACE_UNUSED_ARG (reactor); - } - - // The Reactor must not be null, otherwise something else is - // horribly broken. - ACE_ASSERT(eh_reactor != 0); - - if (TAO_debug_level) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Connection_Handler[%d]::" - "close_connection, removing from the reactor\n", - handle)); - } - int r = - eh_reactor->remove_handler (handle, - (ACE_Event_Handler::ALL_EVENTS_MASK - | ACE_Event_Handler::DONT_CALL)); - if(r == -1 && TAO_debug_level) + // @@ This seems silly, but if we have no reason to be in the + // reactor, then we dont remove ourselves. + if (this->transport ()->wait_strategy ()->is_registered ()) { - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) - Connection_Handler[%d]::" - "close_connection, error in remove_handler (%d)\n", - handle, r)); + ACE_Reactor * eh_reactor = eh->reactor (); + + // These checks are valid as long as the ORB_Core is not + // shutdown. It is good to have these checks and they are valid + // for most of the cases. Please see below for exceptions + if (this->orb_core_->has_shutdown () == 0) + { + // The exception when these are not valid is for RTCORBA. With + // RTCORBA on, you can threads in different lanes creating + // handlers and registering them with reactor in those + // respective lanes. These threads could then even go away + // leaving the task of reclaiming these resources to the main + // thread. For the main thread that takes the responsibility + // of finalizing () the lanes and the pools, the calls and + // comparison make no sense. + ACE_Reactor * reactor = + this->transport()->orb_core()->reactor (); + ACE_ASSERT (eh_reactor == 0 || eh_reactor == reactor); + + ACE_Reactor * orb_core_reactor = this->orb_core_->reactor (); + ACE_ASSERT (reactor == orb_core_reactor); + + if (eh_reactor == 0) + eh_reactor = reactor; + + ACE_UNUSED_ARG (orb_core_reactor); + } + + // The Reactor must not be null, otherwise something else is + // horribly broken. + ACE_ASSERT (eh_reactor != 0); + + if (TAO_debug_level) + { + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Connection_Handler[%d]::" + "close_connection, removing from the reactor\n", + handle)); + } + + int r = + eh_reactor->remove_handler (handle, + (ACE_Event_Handler::ALL_EVENTS_MASK + | ACE_Event_Handler::DONT_CALL)); + if(r == -1 && TAO_debug_level) + { + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) - Connection_Handler[%d]::" + "close_connection, error in remove_handler (%d)\n", + handle, r)); + } + + // Also cancel any timers, we may create those for time-limited + // buffering + if (TAO_debug_level) + { + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - Connection_Handler[%d]::" + "close_connection, cancel all timers and refcount [%d]\n", + handle, reference_count_)); + } + r = eh_reactor->cancel_timer (eh); + if (r == -1 && TAO_debug_level) + { + ACE_ERROR ((LM_ERROR, + "TAO (%P|%t) - Connection_Handler[%d]::" + "close_connection, error cancelling timers\n", + handle)); + } + + // @@ This seems silly, the reactor is a much better authority to + // find out if a handle is registered... + this->transport ()->wait_strategy ()->is_registered (0); } - // Also cancel any timers, we may create those for time-limited - // buffering - if (TAO_debug_level) - { - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - Connection_Handler[%d]::" - "close_connection, cancel all timers and refcount [%d]\n", - handle, reference_count_)); - } - r = eh_reactor->cancel_timer (eh); - if (r == -1 && TAO_debug_level) - { - ACE_ERROR ((LM_ERROR, - "TAO (%P|%t) - Connection_Handler[%d]::" - "close_connection, error cancelling timers\n", - handle)); - } - - // @@ This seems silly, the reactor is a much better authority to - // find out if a handle is registered... - this->transport ()->wait_strategy ()->is_registered (0); - - } |