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(coderd): fix panics by always checking for non-nil request logger#18228

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
mafredri merged 1 commit intomainfrommafredri/fix-coderd-panic-request-log
Jun 12, 2025
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
4 changes: 3 additions & 1 deletioncoderd/inboxnotifications.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -221,7 +221,9 @@ func (api *API) watchInboxNotifications(rw http.ResponseWriter, r *http.Request)
defer encoder.Close(websocket.StatusNormalClosure)

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
rl.WriteLog(ctx, http.StatusAccepted)
}

for {
select {
Expand Down
4 changes: 3 additions & 1 deletioncoderd/provisionerjobs.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -557,7 +557,9 @@ func (f *logFollower) follow() {
}

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(f.ctx).WriteLog(f.ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(f.ctx); rl != nil {
rl.WriteLog(f.ctx, http.StatusAccepted)
}

// no need to wait if the job is done
if f.complete {
Expand Down
12 changes: 9 additions & 3 deletionscoderd/workspaceagents.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -578,7 +578,9 @@ func (api *API) workspaceAgentLogs(rw http.ResponseWriter, r *http.Request) {
defer t.Stop()

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
rl.WriteLog(ctx, http.StatusAccepted)
}

go func() {
defer func() {
Expand DownExpand Up@@ -1047,7 +1049,9 @@ func (api *API) derpMapUpdates(rw http.ResponseWriter, r *http.Request) {
defer encoder.Close(websocket.StatusGoingAway)

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
rl.WriteLog(ctx, http.StatusAccepted)
}

go func(ctx context.Context) {
// TODO(mafredri): Is this too frequent? Use separate ping disconnect timeout?
Expand DownExpand Up@@ -1501,7 +1505,9 @@ func (api *API) watchWorkspaceAgentMetadata(
defer sendTicker.Stop()

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
rl.WriteLog(ctx, http.StatusAccepted)
}

// Send initial metadata.
sendMetadata()
Expand Down
4 changes: 3 additions & 1 deletionenterprise/coderd/provisionerdaemons.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -384,7 +384,9 @@ func (api *API) provisionerDaemonServe(rw http.ResponseWriter, r *http.Request)
})

// Log the request immediately instead of after it completes.
loggermw.RequestLoggerFromContext(ctx).WriteLog(ctx, http.StatusAccepted)
if rl := loggermw.RequestLoggerFromContext(ctx); rl != nil {
rl.WriteLog(ctx, http.StatusAccepted)
}

err = server.Serve(ctx, session)
srvCancel()
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp