Hello,
I have a similar issue. After executing command(s) passed through --eval
, mongosh freezes. But in my case it only does it occasionally and it doesn’t freeze forever. Sometimes it freezes for around 30 seconds, sometimes for several minutes. Often it freezes several times in succession and then works fine for a long time (hours), until it breaks again (although I look at it for several days now, I didn’t find anything it may be related to, yet).
When I run mongosh --quiet --eval 'print(1);'
and it freezes, it can’t be stopped by Ctrl-C, but kill <PID>
from another shell works, exaxctly as Andrzej_Podgorski described.
However, when I run mongosh --quiet --eval 'print(1); exit();'
, it CAN be stopped by Ctrl-C, in which case it prints this message and exits:
$ mongosh --quiet --eval 'print(1); exit();'
1
^CError: Asynchronous execution was interrupted by `SIGINT`
I tried to run it with strace -tt
several times. Outputs can be found on the links below (as a new user, I cannot upload it here). The first one is of a run when it freezes for a very long time (I killed it after 30 minutes), the second one, for comparison, of a run when it freezes for just 15-20 seconds.
I know this will be very difficult to debug. Hopefully the error message and strace output will help.
I’m running it on CentOS 7 (two instances with similar configuration, it happens on both).
mognod v. 5.0.3
mongosh v. 1.0.7
Legacy mongo
shell on the same system works well.