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

An attempt to implement merged context #12318

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sfc-gh-sili
Copy link
Contributor

Description

Link to tracking issue

Fixes #

Testing

Documentation

return mc
}

func (mc mergedContext) Deadline() (time.Time, bool) {
Copy link
Member

Choose a reason for hiding this comment

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

This may be called multiple times, so I think we should pre-calculate this.

Comment on lines +52 to +53
func (mc mergedContext) Done() <-chan struct{} {
return mc.ctx.Done()
}
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to propagate this.

Comment on lines +56 to +63
func (mc mergedContext) Err() error {
var mergedErr error
for _, c := range mc.ctxArr {
if err := c.Err(); err != nil {
mergedErr = multierr.Append(mergedErr, c.Err())
}
}
return mergedErr
}
Copy link
Member

Choose a reason for hiding this comment

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

Ditto.

"go.uber.org/multierr"
)

type mergedContext struct {
Copy link
Member

Choose a reason for hiding this comment

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

The scope is:

  1. Deadline is max of all.
  2. Keep a list of all SpanContext.

We just need these 2 things, not the whole contexts.

@sfc-gh-sili sfc-gh-sili force-pushed the sili-fix-new-batching-context branch from 3ece739 to dac5fd6 Compare February 7, 2025 08:29
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