MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / shouldRetrySSH

Function shouldRetrySSH

utils/ssh.go:401–430  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

399}
400
401func shouldRetrySSH(err error) bool {
402 if err == nil {
403 return false
404 }
405 msg := strings.ToLower(err.Error())
406
407 // Network and connection errors
408 if messageContainsAny(msg,
409 "connection refused",
410 "no route to host",
411 "operation timed out",
412 "i/o timeout",
413 "connection reset",
414 "kex_exchange_identification",
415 "connection closed",
416 "handshake failed",
417 "kex",
418 ) {
419 return true
420 }
421
422 // Auth errors are retried because keys may still be propagating to the instance
423 if messageContainsAny(msg,
424 "unable to authenticate",
425 "no supported methods remain",
426 ) {
427 return true
428 }
429 return false
430}
431
432func sleepWithContext(ctx context.Context, d time.Duration) error {
433 if ctx == nil {

Callers 2

TestShouldRetrySSHFunction · 0.85

Calls 2

messageContainsAnyFunction · 0.85
ErrorMethod · 0.45

Tested by 1

TestShouldRetrySSHFunction · 0.68