1 This test is for validating the fix for a race condition exposed in the
2 Transport_Cache_Manager. The problem is that an internal pointer used
3 to test intermediate return values to the cache may be deleted by one
4 thread before another thread tries to use it.
6 This situation is replicated by having a bidirectional connection set up
7 between a client and a server, the client provides a callback reference
8 that the server uses via the bidir connection. The server uses multiple
9 threads to force a thread into the wait state, and the client terminates
10 abruptly, setting the condition for the race.
12 $ server -ORBSvcConf server.conf -o <file.ior>
13 $ client -ORBSvcConf client.conf -k file://<file.ior> -x
19 Even with this optimized test case, the condition is hard to trigger.
20 To reliably trigger the error before fixing TAO, apply this patch to
21 $TAO_ROOT/tao/Transport_Cache_Manager.cpp
23 Index: Transport_Cache_Manager.cpp
24 ===================================================================
25 RCS file: /cvs/ocitao/ACE_wrappers/TAO/tao/Transport_Cache_Manager.cpp,v
26 retrieving revision 1.1.1.3.2.5.14.1
27 diff -u -b -r1.1.1.3.2.5.14.1 Transport_Cache_Manager.cpp
28 --- Transport_Cache_Manager.cpp 8 Mar 2007 22:33:14 -0000 1.1.1.3.2.5.14.1
29 +++ Transport_Cache_Manager.cpp 1 Aug 2007 19:18:21 -0000
32 entry->int_id_.recycle_state (ACE_RECYCLABLE_BUSY);
34 + ACE_Time_Value tv (0,500);
37 // NOTE: This assignment operator indirectly incurs two
38 // lock operations since it duplicates and releases
39 // TAO_Transport objects.
42 Once TAO is fixed, the following patch adds the same delay to the
43 refactored Transport Cache Manager:
46 --- .#Transport_Cache_Manager.cpp.1.1.1.3.2.5.14.1 2007-08-01 09:26:52.000000000 -0500
47 +++ Transport_Cache_Manager.cpp 2007-08-01 14:40:47.000000000 -0500
49 found = CACHE_FOUND_AVAILABLE;
50 entry->int_id_.recycle_state (TAO::ENTRY_BUSY);
52 + ACE_Time_Value tv (0,500);
55 // NOTE: This assignment operator indirectly incurs two
56 // lock operations since it duplicates and releases
57 // TAO_Transport objects.