reapply: "fix: refactor coder logger to allow flush without deadlock (#375)"#377
Merged
reapply: "fix: refactor coder logger to allow flush without deadlock (#375)"#377
Conversation
Member
mafredri
commented
Sep 30, 2024
- reapply: "fix: refactor coder logger to allow flush without deadlock (fix: refactor coder logger to allow flush without deadlock #375)"
- fix stackoverflow, paranoid teardown
mafredri
commented
Sep 30, 2024
| metaLogger.Warn(ctx, "Sending logs via AgentAPI v2", slog.F("coder_version", bi.Version)) | ||
| sendLogs, doneFunc := sendLogsV2(ctx, dac, ls, metaLogger.Named("send_logs_v2")) | ||
| return sendLogs, doneFunc, nil | ||
| logger, loggerCloser := sendLogsV2(ctx, dac, ls, metaLogger.Named("send_logs_v2")) |
Member
Author
There was a problem hiding this comment.
Review: This used to be called closer, i.e. return variable name. After a last minute change in #375 we wrapped this function to ensure we can close drpcconn as well. This resulted in the variable being reassigned and calling itself.
goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc048806380 stack=[0xc048806000, 0xc068806000]
fatal error: stack overflow
runtime stack:
runtime.throw({0x2088d94?, 0x200000001?})
/usr/local/go/src/runtime/panic.go:1023 +0x5c fp=0x7ffdb0730768 sp=0x7ffdb0730738 pc=0x43e05c
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1103 +0x5bd fp=0x7ffdb0730918 sp=0x7ffdb0730768 pc=0x45a77d
runtime.morestack()
/usr/local/go/src/runtime/asm_amd64.s:616 +0x7a fp=0x7ffdb0730920 sp=0x7ffdb0730918 pc=0x477b3a
| if err != nil { | ||
| cancel() | ||
| } | ||
| }() |
Member
Author
There was a problem hiding this comment.
Review: This is a cautious addition to ensure there's no internal logic in client.ConnectRPC20(ctx) that might block or leave the connection open. This is to make it safer to call drpcconn close later.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.