@@ -4,22 +4,24 @@ import (
4
4
"context"
5
5
"errors"
6
6
"fmt"
7
+ "io"
7
8
"math"
8
9
"net"
9
10
"sync"
10
11
"time"
11
12
12
13
"github.com/sirupsen/logrus"
13
14
15
+ "google.golang.org/grpc/codes"
16
+ grpcstatus "google.golang.org/grpc/status"
17
+ "google.golang.org/protobuf/types/known/timestamppb"
18
+
14
19
"github.com/nais/device/internal/device-agent/config"
15
20
"github.com/nais/device/internal/device-agent/runtimeconfig"
16
21
"github.com/nais/device/internal/device-agent/statemachine"
17
22
"github.com/nais/device/internal/notify"
18
23
"github.com/nais/device/internal/pb"
19
24
"github.com/nais/device/internal/version"
20
- "google.golang.org/grpc/codes"
21
- grpcstatus "google.golang.org/grpc/status"
22
- "google.golang.org/protobuf/types/known/timestamppb"
23
25
)
24
26
25
27
const (
@@ -103,8 +105,11 @@ func (c *Connected) Enter(ctx context.Context) statemachine.Event {
103
105
c .notifier .Errorf ("Unauthenticated: %v" , err )
104
106
c .rc .SetToken (nil )
105
107
return statemachine .EventDisconnect
108
+ case errors .Is (e , io .EOF ):
109
+ c .logger .Infof ("Connection unexpectedly lost (EOF), reconnecting..." )
110
+ attempt = 0
106
111
case errors .Is (e , ErrLostConnection ):
107
- c .logger .Infof ("Lost connection, reconnecting.." )
112
+ c .logger .Infof ("Lost connection, reconnecting... " )
108
113
attempt = 0
109
114
case errors .Is (e , context .DeadlineExceeded ):
110
115
c .logger .Infof ("syncConfigLoop deadline exceeded: %v" , err )
0 commit comments