Skip to content

Conversation

mafredri
Copy link
Member

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"))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()
}
}()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unblocking 👍

@mafredri mafredri merged commit b3d1ec8 into main Sep 30, 2024
4 checks passed
@mafredri mafredri deleted the mafredri/logssss-unrevert branch September 30, 2024 17:06
mafredri added a commit that referenced this pull request Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants