I thought I’d revive this post given that I’m still experiencing the issues described…
Some further thoughts:
- I’m currently refactoring part of these scripts to use Node/Javascript instead of bash + mongosh.
- I may change how I control my ssh tunnel so that my script runs faster
- currently I’m using ssh tunnels that auto-close,
- I’m going to play around with ssh’s
master mode, to send control commands over a socket - see this post for a discussion on the different approaches