[SERVER-77324] Improve error semantics for ConnectionPool controllers' untracked pools Created: 19/May/23  Updated: 30/May/23

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

Type: Improvement Priority: Major - P3
Reporter: George Wangensteen Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Service Arch
Participants:

 Description   

Currently, we consider it a bug issue if a ConnectionPool::ControllerInterface implementation is asked to update state or provide information about a host that wasn't previously registered with the controller via addHost. Similarly, we consider it a correctness error if the same host was registered with the controller multiple times.

In each case, we invariant in the controller when we detect this issue. However, the error likely originates not in the controller's maintenance of the maps, but in the calling-code that forgot to register a pool or registers the same one multiple times. Throwing an error and allowing the calling-code to handle it (including by possibly invarianting) would improve the readability + maintainability of the code, produce better/more descriptive errors, and would allow us to remove the use of the helpers getOrInvariant and emplaceOrInvariant and replace them with ordinary standard library container API calls.


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