-
Notifications
You must be signed in to change notification settings - Fork 891
fix: use a native websocket.NetConn for agent RPC client #13142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @spikecurtis and the rest of your teammates on |
// Set the read limit to 4 MiB -- about the limit for protobufs. This needs to be larger than | ||
// the default because some of our protocols can include large messages like startup scripts. | ||
conn.SetReadLimit(1 << 22) | ||
netConn := websocket.NetConn(ctx, conn, websocket.MessageBinary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is no longer wrapped via custom closer below, there's a slight change in behavior, this will be used instead:
c.c.Close(StatusNormalClosure, "")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, but I don't think it matters in any meaningful way. The server doesn't act any differently based on the close code or message.
9392155
to
92f0f66
Compare
f684439
to
ac491e5
Compare
92f0f66
to
094ce97
Compare
ac491e5
to
505cd04
Compare
094ce97
to
4e4c469
Compare
505cd04
to
c0536b6
Compare
4e4c469
to
4ad81b0
Compare
c0536b6
to
667b718
Compare
Merge activity
|
One cause of #13139 is a peculiar failure mode of
WebsocketNetConn
which causes it to returncontext.Canceled
in some circumstances when the underlying websocket fails. We have special processing for that error in theagent.run()
routine, which is erroneously being triggered.Since we don't actually need the returned context from
WebsocketNetConn
, we can simplify and just use the netConn from thewebsocket
library directly.