[SERVER-64058] Clean up duplicate setPromiseFromStatusIfNotReady functions Created: 28/Feb/22  Updated: 06/Dec/22

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

Type: Improvement Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis 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   

tenant_migration_donor_service.cpp and tenant_migration_recipient_service.cpp define overlapping sets of functions (with different capitalization of "if"):

  • setPromiseOkIfNotReady
  • setPromiseFromStatusIfNotReady
  • setPromiseErrorIfNotReady

It's controversial whether we should test-and-set Promises like this at all. Let's clean up this mess. Don't factor them into future.h or future_util.h, because that would only encourage more usage of these functions, which are considered an anti-pattern. Put them in a tenant migration utility file, or eliminate their use entirely. The latter would be a project.



 Comments   
Comment by Blake Oler [ 11/Apr/22 ]

Keeping this on the backlog, awaiting resolution re conversation with jesse@mongodb.com, this looks like this is a potential issue with the usage of PrimaryOnlyService/Futures. I'm inclined to assign this back to whoever owns these setPromiseFromStatusIfNotReady functions, and will do so if there aren't any objections soon.

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