cf-mysql-plugin
cf-mysql-plugin copied to clipboard
Feature Request: Automatically re-establish SSH tunnel on "Connection reset by peer"
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.
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.
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