@Andrzej_Podgorski The problem is that this is hard to debug without a reproduction – I’m also running Ubuntu but haven’t had an issue like this so far.
I guess you could explicitly use something like mongosh --eval "print(1); exit();"
or mongosh --eval "print(1); process.exit();"
to explicitly stop the shell? I know it’s not a great solution, but I’m also not sure how else to move forward here.
If you are willing to debug this in depth (which we are grateful for but obviously don’t expect of you) on Ubuntu, running mongosh under strace might be pretty helpful (although the log it generates would presumably be huge).