-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: 1.46.4
-
Component/s: None
-
Environment:OS: macOS 15.5 (24F74)
Compass: version 1.46.4 (1.46.4)
mongosh: version 2.5.1
-
None
-
None
-
Developer Tools
Problem Statement/Rationale
When pausing script execution with `sleep` crashes connection window. The Compass window becomes blank and doesn't respond anymore. See screenshot attached. It can only be closed. Compass as a whole is still responsive and a new connection window can be opened.
The Compass log files don't show any entry after the entry which logs the code being pasted into the Compass mongosh window for execution.{}{}
Steps to Reproduce
- Open Compass, create a new connection, connect to a replica set, click on the "MongoDB shell" icon to open a new tab with mongosh connected to the replica set.
- Paste the following code into mongosh:
```
function testSleep() { print("Waiting 2 seconds..."); sleep(2000); print("Done"); }testSleep();
``` - The shell halts execution forever and never prints `Done`.
- Press Ctrl+C to abort the script.
- Paste the following code into mongosh:
```
async function testSleep() { print("Waiting 2 seconds..."); awaitsleep(2000); print("Done"); }testSleep();
- The shell halts execution forever and never prints `Done`.
- Press Ctrl+C to abort the script.
- Pause the following code into mongosh:
```
async function testSleep() { print("Waiting 2 seconds..."); awaitnewPromise(resolve=>setTimeout(resolve, 2000)); print("Done"); }testSleep();
```
- The Compass connection window turns blank and doesn't respond anymore.
Expected Results
In all script cases described above, script execution should be paused for 2 seconds and then continue, printing "Done".
Actual Results
Script execution fails as described above.
Additional Notes
In all script cases described above, when using mongosh in a macOS terminal window, the script executes correctly and execution is paused by 2 seconds. Hence, the same behavior is expected in a Compass mongosh window.