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

fix: extend locking in wsproxy to avoid race (and fix flake)#14167

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sreya merged 2 commits intomainfromjon/wsproxyflake
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionenterprise/wsproxy/wsproxy.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -463,7 +463,7 @@ func (s *Server) pingSiblingReplicas(replicas []codersdk.Replica) {
errStr := pingSiblingReplicas(ctx, s.Logger, &s.replicaPingSingleflight, s.derpMeshTLSConfig, replicas)
s.replicaErrMut.Lock()
s.replicaErr = errStr
s.replicaErrMut.Unlock()
defers.replicaErrMut.Unlock()
if s.Options.ReplicaErrCallback != nil {
s.Options.ReplicaErrCallback(replicas, s.replicaErr)
}
Expand Down
8 changes: 4 additions & 4 deletionsenterprise/wsproxy/wsproxy_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -312,7 +312,7 @@ resourceLoop:
t.Parallel()

// Try to connect to the DERP server on the no-derp-proxy region.
client, err := derphttp.NewClient(key.NewNode(), proxyAPI3.Options.AccessURL.String(), func(formatstring, args ...any) {})
client, err := derphttp.NewClient(key.NewNode(), proxyAPI3.Options.AccessURL.String(), func(string, ...any) {})
require.NoError(t, err)

ctx := testutil.Context(t, testutil.WaitLong)
Expand DownExpand Up@@ -405,7 +405,7 @@ func TestDERPEndToEnd(t *testing.T) {
proxyOnlyDERPMap.OmitDefaultRegions = true
return true
}, testutil.WaitLong, testutil.IntervalMedium)
newDERPMapper := func(derpMap *tailcfg.DERPMap) *tailcfg.DERPMap {
newDERPMapper := func(_ *tailcfg.DERPMap) *tailcfg.DERPMap {
return proxyOnlyDERPMap
}
api.AGPL.DERPMapper.Store(&newDERPMapper)
Expand DownExpand Up@@ -577,7 +577,7 @@ func TestWorkspaceProxyDERPMeshProbe(t *testing.T) {
registerBrokenProxy := func(ctx context.Context, t *testing.T, primaryAccessURL *url.URL, accessURL, token string) uuid.UUID {
t.Helper()
// Create a HTTP server that always replies with 500.
srv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter,r *http.Request) {
srv := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter,_ *http.Request) {
rw.WriteHeader(http.StatusInternalServerError)
}))
t.Cleanup(srv.Close)
Expand DownExpand Up@@ -848,7 +848,7 @@ func TestWorkspaceProxyDERPMeshProbe(t *testing.T) {
proxy := coderdenttest.NewWorkspaceProxyReplica(t, api, client, &coderdenttest.ProxyOptions{
Name: "proxy-2",
ProxyURL: proxyURL,
ReplicaPingCallback: func(replicas []codersdk.Replica, err string) {
ReplicaPingCallback: func(_ []codersdk.Replica, err string) {
replicaPingErr <- err
},
})
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp