Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit3ebd102

Browse files
authored
fix: Continue attempting connections no matter what (#412)
* fix: Continue accepting connections after yamux session EOFs* Add verbosity to timeout* Revert test* Revert test change* Never exit when connection fails* Remove useless log
1 parent9244ee8 commit3ebd102

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

‎internal/cmd/agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ coder agent start --coder-url https://my-coder.com --token xxxx-xxxx
8484
returnxerrors.Errorf("listen: %w",err)
8585
}
8686
deferfunc() {
87+
log.Info(ctx,"closing wsnet listener")
8788
err:=listener.Close()
8889
iferr!=nil {
8990
log.Error(ctx,"close listener",slog.Error(err))

‎wsnet/listen.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func Listen(ctx context.Context, log slog.Logger, broker string, turnProxyAuthTo
7171
default:
7272
}
7373

74-
iferrors.Is(err,io.EOF)||errors.Is(err,yamux.ErrKeepAliveTimeout) {
74+
iferr!=nil {
7575
l.log.Warn(ctx,"disconnected from broker",slog.Error(err))
7676

7777
// If we hit an EOF, then the connection to the broker
@@ -88,14 +88,11 @@ func Listen(ctx context.Context, log slog.Logger, broker string, turnProxyAuthTo
8888
iferr==nil||errors.Is(err,context.Canceled)||errors.Is(err,context.DeadlineExceeded) {
8989
break
9090
}
91+
l.log.Warn(ctx,"connecting to broker failed",slog.Error(err))
9192
}
9293
ticker.Stop()
9394
}
94-
iferr!=nil {
95-
l.acceptError=err
96-
_=l.Close()
97-
break
98-
}
95+
l.log.Info(ctx,"connected to broker")
9996
}
10097
}()
10198
returnl,nil
@@ -106,7 +103,6 @@ type listener struct {
106103
turnProxyAuthTokenstring
107104

108105
log slog.Logger
109-
acceptErrorerror
110106
ws*websocket.Conn
111107
connClosers []io.Closer
112108
connClosersMut sync.Mutex

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp