cf-mysql-plugin icon indicating copy to clipboard operation
cf-mysql-plugin copied to clipboard

Feature Request: Automatically re-establish SSH tunnel on "Connection reset by peer"

Open waterlink opened this issue 7 years ago • 2 comments

Currently, given sufficient amount of time, or after workstation has gone to sleep, the SSH tunnel is disconnected. When this happens, we have to re-run cf mysql <name> command.

waterlink avatar Dec 11 '16 23:12 waterlink

As discussed off-line, we shouldn't normally do that, because users might pipe script input into this command and then re-establishing a connection silently might be a bad idea.

I think, we ought to be able to detect if input is piped or not. If we can, then we can have a mode of operation: interactive or non-interactive. This should be sufficient to resolve this problem. I will take a look if that is something possible and simple to do.

waterlink avatar Dec 28 '16 23:12 waterlink

Yes. It is possible to detect if the process is running in the interactive or pipe mode. PoC of such detection mechanism can be found in this 'git compare': https://github.com/andreasf/cf-mysql-plugin/compare/master...waterlink:poc-interactivity-detection

waterlink avatar Jan 01 '17 17:01 waterlink