[SERVER-53893] Connpool host-to-pool map is poorly structured Created: 19/Jan/21  Updated: 06/Dec/22  Resolved: 05/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Billy Donahue Assignee: Backlog - Service Architecture
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Service Arch
Operating System: ALL
Participants:

 Description   

client/connpool.

{h,cpp}

is one of those places where we have poor C++ style and usage.
There's a std::map that uses a very unusual comparator that uses only part of the key. It's really abusing the std::map API and it's a lot of extra fancy footwork we don't need to do.

The implementation could be much more elegantly expressed in other ways as well, like using modern C++ like CTAD, auto, ranged-for, structured bindings, etc. It would be much easier to follow at that point.



 Comments   
Comment by Mira Carey [ 21/Jan/21 ]

How much do we use client/connpool.(h|cpp) at all? I think that's more or less our legacy connection pool code, maybe used in a handful of blocking use cases in sharding? I'm honestly not sure what we use it for at this point.

If we could, I'd prefer getting rid of all it's consumers and then it, over turning it into something nice and modern (because in addition to being old, crufty and bad, it also lacks all of the modern bells and whistles we've spent the past few years adding to execution/connection_poll)

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