Skip to content
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

fix: go sdk and api updates to latest #161

Merged
merged 3 commits into from
Feb 28, 2024
Merged

fix: go sdk and api updates to latest #161

merged 3 commits into from
Feb 28, 2024

Conversation

nilslice
Copy link
Member

Updates the Go APIs to use the latest names.

Also, without the new check and minimum default setting in trace_ctx.go, any custom setting to the observe trace config options without ChannelBufferSize would use its zero value (0), and would block the SDK from handling events.

@nilslice nilslice requested a review from bhelx February 28, 2024 20:51
go/trace_ctx.go Outdated Show resolved Hide resolved
@@ -33,6 +33,11 @@ func newTraceCtx(ctx context.Context, eventsChan chan TraceEvent, r wazero.Runti
return nil, err
}

if opts.ChannelBufferSize == 0 {
opts.ChannelBufferSize = 64 // set a reasonable minimum here so unset option doesn't block execution on an unbuffered channel
Copy link
Contributor

Choose a reason for hiding this comment

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

Just for my clarity, this is a message size and not a byte size right? so 64 messages in the buffer?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, 64 items on the channel until it blocks

Copy link
Member Author

Choose a reason for hiding this comment

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

in Go, you call these "buffered channels" which have more than 0 capacity. or "unbuffered channels" which expect the channel to be read immediately unless a write will block. hence the name ChannelBufferSize, which can definitely be confusing if thinking about a more common byte buffer

@nilslice nilslice merged commit 6b4627e into main Feb 28, 2024
4 of 6 checks passed
@nilslice nilslice deleted the update-go-apis branch February 28, 2024 20:55
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.

None yet

2 participants