[SERVER-35662] Future::isReady() should use memory_order_acquire Created: 18/Jun/18  Updated: 29/Oct/23  Resolved: 02/Jul/18

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

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2018-07-02
Participants:

 Description   

While the rationale for making it relaxed is probably valid for external callers, an internal caller[1] is already using it incorrectly. Rather than fixing the internal caller, it seems easier and less bug-prone to just make isReady() do an acquire-load.

[1] That method is only called from its unittest at the moment, so there is no bug in the shipping binaries.



 Comments   
Comment by Githook User [ 02/Jul/18 ]

Author:

{'username': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: SERVER-35662 Make Future::isReady() use memory_order_acquire

This fixes a data race in onError<ErrorCode>(...) that relies on isReady()
doing an acquire-load.
Branch: master
https://github.com/mongodb/mongo/commit/08c906d4691f977c0a007780d9adc5128764eb35

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