[SERVER-35684] Remove promise.getFuture() Created: 19/Jun/18  Updated: 29/Oct/23  Resolved: 26/Jul/18

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

Type: New Feature Priority: Major - P3
Reporter: Mira Carey Assignee: ADAM Martin (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Platforms 2018-07-16, Platforms 2018-07-30
Participants:

 Description   

promise.getFuture() is racy with setting the promise. Now that we have makePromiseFuture<T>, we should remove the dangerous variant.



 Comments   
Comment by Billy Donahue [ 13/Sep/21 ]

I would like to understand what races this was done to avoid.

Comment by Githook User [ 17/Aug/18 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-35056 Flush ready callbacks on NetworkInterfaceTL shutdown

Squashed from 3 commits:

SERVER-35684 Remove `promise.getFuture()`

This API invites subtle race conditions. So just remove it, and
force everyone to use a unified API which creates a promise and
a future at the same time.

(cherry picked from commit 2338f365430d7f395faf73bff6c64def505da1b3)

SERVER-35056 Flush ready callbacks on NetworkInterfaceTL shutdown

(cherry picked from commit b49a27b359b17cd1b1560134b89527b78db565cc)

SERVER-36466 Secure shutdown conditions for SpecificPool

(cherry picked from commit 5e0545d3625dc85d16f5f021896f61d3a21e2333)
Branch: v4.0
https://github.com/mongodb/mongo/commit/6c33879eaa545136f8e1c747780ffd3ccb493dce

Comment by Benjamin Caimano (Inactive) [ 17/Aug/18 ]

Goes in cleanly and it makes things simple for BACKPORT-2316

Comment by Githook User [ 26/Jul/18 ]

Author:

{'username': 'adamlsd', 'name': 'ADAM David Alan Martin', 'email': 'adam.martin@10gen.com'}

Message: SERVER-35684 Remove `promise.getFuture()`

This API invites subtle race conditions. So just remove it, and
force everyone to use a unified API which creates a promise and
a future at the same time.
Branch: master
https://github.com/mongodb/mongo/commit/2338f365430d7f395faf73bff6c64def505da1b3

Generated at Thu Feb 08 04:40:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.