(jobId string, connName string)
| 397 | } |
| 398 | |
| 399 | func attemptAutoReconnect(jobId string, connName string) { |
| 400 | defer func() { |
| 401 | panichandler.PanicHandler("jobcontroller:attemptAutoReconnect", recover()) |
| 402 | }() |
| 403 | |
| 404 | time.Sleep(AutoReconnectDelay) |
| 405 | |
| 406 | isConnected, err := conncontroller.IsConnected(connName) |
| 407 | if err != nil || !isConnected { |
| 408 | log.Printf("[job:%s] connection %s is down, skipping auto-reconnect", jobId, connName) |
| 409 | return |
| 410 | } |
| 411 | |
| 412 | log.Printf("[job:%s] connection %s still up after route down, attempting auto-reconnect to determine job manager status", jobId, connName) |
| 413 | ctx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second) |
| 414 | defer cancelFn() |
| 415 | err = ReconnectJob(ctx, jobId, nil) |
| 416 | if err != nil { |
| 417 | log.Printf("[job:%s] auto-reconnect failed: %v", jobId, err) |
| 418 | } else { |
| 419 | log.Printf("[job:%s] auto-reconnect succeeded", jobId) |
| 420 | } |
| 421 | } |
| 422 | |
| 423 | func handleConnChangeEvent(event *wps.WaveEvent) { |
| 424 | var connStatus wshrpc.ConnStatus |
no test coverage detected