drone-ssh icon indicating copy to clipboard operation
drone-ssh copied to clipboard

Timeout for retrying initial ssh connection

Open joshdk opened this issue 6 years ago • 4 comments

joshdk avatar Mar 06 '18 05:03 joshdk

Codecov Report

Merging #118 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #118   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         107    129   +22     
=====================================
+ Hits          107    129   +22
Impacted Files Coverage Δ
plugin.go 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c0b475...b40bfc5. Read the comment docs.

codecov-io avatar Mar 06 '18 05:03 codecov-io

The motivation behind this feature is that in our Drone build we dynamically provision a VM, then run commands on it for testing (see my comments here).

This VM is quickly "up" from a cloud infrastructure perspective, but it is often the case where SSHD needs an additional ~30 seconds to be functional. This PR adds an additional PLUGIN_RETRY_TIMEOUT value that allows a developer to specify how long to attempt to connect to the host for, retrying whenever a network error is encountered, with exponential backoff.

Basically prevents your entire build from turning red, just because your SSH daemon took a few seconds too long to start 😄

Cheers!

joshdk avatar Mar 06 '18 06:03 joshdk

@appleboy do you have any thoughts on this PR? I would be happy to hear any feedback you have 😄

joshdk avatar Mar 09 '18 05:03 joshdk

I will take this.

appleboy avatar Mar 10 '18 07:03 appleboy