-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Environment:OS:
node.js / npm versions:
Additional info:
-
Not Needed
-
None
-
Developer Tools
Problem Statement/Rationale
What is going wrong? What action would you like the Engineering team to take?
When using the typical sleep implementation depending on setTimeout and the promise constructor, Compass crashes leaving a white screen without any reaction to the user.
Please be sure to attach relevant logs with any sensitive data redacted.
How to retrieve logs for: Compass; Shell
Steps to Reproduce
How could an engineer replicate the issue you’re reporting?
Go to the integrated shell and run the following code snippet:
const sleep = (delay) => new Promise((resolve) => setTimeout(resolve, delay)) sleep(1)
Expected Results
What do you expect to happen?
setTimeout is a function that we are removing from the global scope (calling it in the root scope says the function does not exist). We should expect a similar error when defining the function, or in the worst case scenario, when the actual function is called.
Actual Results
What do you observe is happening?
Compass just crashes and the only way to recover is either Ctrl-R to restart the whole process or closing and opening Compass.
Additional Notes
Any additional information that may be useful to include.
Attached a recording of the issue.
- is related to
-
COMPASS-9267 calling sleep in the mongosh freezes the shell and won't finish
-
- Backlog
-