[SERVER-52701] Integrate PrimaryOnlyServiceRegistry creation into ShardingMongodTestFixture Created: 09/Nov/20  Updated: 06/Dec/22  Resolved: 05/Jun/21

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

Type: Task Priority: Major - P3
Reporter: Blake Oler Assignee: [DO NOT USE] Backlog - Sharding NYC
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-52658 Shut down the Grid's executor before ... Closed
Assigned Teams:
Sharding NYC
Participants:
Story Points: 1

 Description   

Background/Problem

The PrimaryOnlyServiceRegistry relies on specific ordering for shutdown in sharding unit tests:

  1. Grid executor pool, then
  2. PrimaryOnlyServiceRegistry

This ordering is necessary because the PrimaryOnlyServiceRegistry waits to join all executors associated with specific service instances. If any of these network executors are waiting on network calls to be consumed from the mock network queue, then the PrimaryOnlyServiceRegistry will indefinitely hang.

Solution

The only way to solve this is to either consume all pending network calls before shutting down the test, or the more general case, to shut down the executor pool before shutting down the PrimaryOnlyServiceRegistry.

For this ticket, the solution will be to allow for the creation of a PrimaryOnlyServiceRegistry in ShardingMongodTestFixture, then ensure that proper shutdown ordering is maintained if a PrimayOnlyServiceRegistry was ever created.

Notes

A similar ticket will be created to more immediately address this issue in a BF, and will be linked below.



 Comments   
Comment by Max Hirschhorn [ 05/Jun/21 ]

We created new fixtures that are targeted for the donor (SERVER-54981), recipient (SERVER-55288), and coordinator (SERVER-55818) instead.

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