Skip to content

Commit 2b42672

Browse files
committed
Move several log messages to the debug level
Fix issue 392 Fix lima-vm/lima issue 1160 Signed-off-by: Akihiro Suda <[email protected]>
1 parent 7f42256 commit 2b42672

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

pkg/services/forwarder/tcp.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ func TCP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute
4242
ep, tcpErr := r.CreateEndpoint(&wq)
4343
r.Complete(false)
4444
if tcpErr != nil {
45-
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
45+
if _, ok := tcpErr.(*tcpip.ErrConnectionRefused); ok {
46+
// transient error
47+
log.Debugf("r.CreateEndpoint() = %v", tcpErr)
48+
} else {
49+
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
50+
}
4651
return
4752
}
4853

pkg/services/forwarder/udp.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ func UDP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mute
3131
var wq waiter.Queue
3232
ep, tcpErr := r.CreateEndpoint(&wq)
3333
if tcpErr != nil {
34-
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
34+
if _, ok := tcpErr.(*tcpip.ErrConnectionRefused); ok {
35+
// transient error
36+
log.Debugf("r.CreateEndpoint() = %v", tcpErr)
37+
} else {
38+
log.Errorf("r.CreateEndpoint() = %v", tcpErr)
39+
}
3540
return
3641
}
3742

pkg/tap/switch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (e *Switch) DeliverNetworkPacket(_ tcpip.NetworkProtocolNumber, pkt *stack.
8080

8181
func (e *Switch) Accept(ctx context.Context, rawConn net.Conn, protocol types.Protocol) error {
8282
conn := protocolConn{Conn: rawConn, protocolImpl: protocolImplementation(protocol)}
83-
log.Infof("new connection from %s to %s", conn.RemoteAddr().String(), conn.LocalAddr().String())
83+
log.Debugf("new connection from %s to %s", conn.RemoteAddr().String(), conn.LocalAddr().String())
8484
id, failed := e.connect(conn)
8585
if failed {
8686
log.Error("connection failed")

0 commit comments

Comments
 (0)