diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2007-09-10 12:28:31 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2007-09-10 12:28:31 +0000 |
commit | af4ee37c90bf0f7010b8c29217e67a4a31b202d9 (patch) | |
tree | d2584684ae5cc601c1d0adf459b9355cfae29a41 | |
parent | 293b6d8a4731667094970e47cfc658470da0e3a3 (diff) | |
download | ATCD-af4ee37c90bf0f7010b8c29217e67a4a31b202d9.tar.gz |
Mon Sep 10 12:17:24 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r-- | ACE/ChangeLog | 21 | ||||
-rw-r--r-- | ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp | 26 |
2 files changed, 41 insertions, 6 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index d6f22bbfbc6..537d22e846d 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,24 @@ +Mon Sep 10 12:17:24 UTC 2007 Phil Mesnier <mesnier_p@ociweb.com> + + * tests/MT_Reference_Counted_Event_Handler_Test.cpp: + Add timeouts to recv_n and send_n calls to ensure the calling + loops always exit. + + This is necessary due to certain races that can occur between + the start up of new send/recv threads, and the shutdown of + individual thread loops. What sometimes happens is that a thread + is started to read from a socket, and then a different thread + closes down the read-side of the socket. But due to thread + startup delays, the send side never gets to the point where it + detects the close, effectively leaving a half-closed connection. + + In this case, on "weevil" a Windows 2003 server, the thread + blocked in recv on the half closed socket is not killed by the + nightly test script's shutdown signal, leaving a zombie + process. This zombie holds a lock on the libACE.dll file, which + then cannot be rebuilt, and as a result, subsequent nightly + builds fail catastrophically. + Mon Sep 10 11:19:20 UTC 2007 Abdullah Sowayan <abdullah.sowayan@lmco.com> * bin/fuzz.pl: diff --git a/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp b/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp index 51f11b03f64..f231f2123ef 100644 --- a/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp +++ b/ACE/tests/MT_Reference_Counted_Event_Handler_Test.cpp @@ -319,9 +319,12 @@ Sender::close (void) ssize_t Sender::send_message (void) { + ACE_Time_Value timeout (0, close_timeout * 1000); + return ACE::send_n (this->handle_, message, - message_size); + message_size, + &timeout); } class Event_Loop_Thread : public ACE_Task_Base @@ -407,7 +410,8 @@ Receiver::svc (void) int result = 0; ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%t) Receiver::svc commencing\n"))); + ACE_TEXT("(%t) Receiver::svc commencing, handle = %d\n"), + this->handle_)); while (result != -1) { @@ -415,7 +419,8 @@ Receiver::svc (void) this->handle_input (this->handle_); } ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%t) Receiver::svc terminating\n"))); + ACE_TEXT("(%t) Receiver::svc terminating, handle = %d\n"), + this->handle_)); return 0; } @@ -424,11 +429,20 @@ Receiver::handle_input (ACE_HANDLE handle) { char buf[message_size + 1]; + ACE_Time_Value timeout (0, close_timeout * 1000); + // Receive message. ssize_t result = ACE::recv_n (handle, buf, - sizeof buf - 1); + message_size, + &timeout); + + if (debug && result < 1) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT("(%t) Receiver::handle input, ") + ACE_TEXT("h = %d, result = %d %p\n"), + handle_, result, ACE_TEXT("ACE::recv_n"))); if (this->reactor ()) this->reactor ()->resume_handler (handle); @@ -1078,7 +1092,7 @@ int Purger_Thread::svc (void) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%t) Event_Loop_Thread::svc commencing\n"))); + ACE_TEXT("(%t) Purger_Thread::svc commencing\n"))); for (; !this->reactor_.reactor_event_loop_done ();) { @@ -1105,7 +1119,7 @@ Purger_Thread::svc (void) } } ACE_DEBUG ((LM_DEBUG, - ACE_TEXT("(%t) Event_Loop_Thread::svc terminating\n"))); + ACE_TEXT("(%t) Purger_Thread::svc terminating\n"))); return 0; } |