[SERVER-17956] NetworkInterfaceMock hangs at shutdown if currentlyRunning = network Created: 09/Apr/15  Updated: 06/Dec/22  Resolved: 03/Jan/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Operating System: ALL
Steps To Reproduce:

Throw an exception after calling enterNetwork() in a test fixture run in the unittest framework.

Participants:

 Description   

If a unittest ASSERT fails after a call to enterNetwork() but before a call to exitNetwork(), the process may hang. This is because the ReplicationExecutor shutdown logic does not handle the case where all the work and event items are drained with "Cancelled" status, but the state of the NetworkInterfaceMock is still waiting for a simulated network thread to finish running.
This can be fixed by ensuring exitNetwork() is called via any exit path (using ScopeGuard, for example), but it might be more convenient to make improvements to NetworkInterfaceMock to avoid such hangs.



 Comments   
Comment by Judah Schvimer [ 03/Jan/20 ]

We will make this change if it is required for new testing.

Generated at Thu Feb 08 03:46:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.