[SERVER-79402] Results of async functions are lost when executing in parallel shell Created: 27/Jul/23  Updated: 29/Oct/23  Resolved: 28/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matt Broadstone Assignee: Matt Broadstone
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: Server Serverless 2023-08-07
Participants:

 Description   

If you run the following code

startParallelShell(async () => {
    throw new Error('intentionally thrown');
}, undefined, true)();

the shell will print a {} result, and report that the parallel shell completed successfully.



 Comments   
Comment by Githook User [ 28/Jul/23 ]

Author:

{'name': 'Matt Broadstone', 'email': 'mbroadst@mongodb.com', 'username': 'mbroadst'}

Message: SERVER-79402 Wrap async functions with await in parallel shell
Branch: master
https://github.com/mongodb/mongo/commit/23c92c3cca727209a68e22d2d9cabe46bac11bb1

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