-
Notifications
You must be signed in to change notification settings - Fork 92
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: deal with orphan traces in trace cache #1405
Conversation
i.PeerTransmission.EnqueueEvent(i.createDecisionSpan(&types.Span{ | ||
TraceID: trace.ID(), | ||
Event: types.Event{ | ||
Context: trace.GetSpans()[0].Context, | ||
}, | ||
}, trace, i.Sharder.WhichShard(trace.ID()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious what impact this will have on network traffic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an edge case and we are essentially just sending a trace id. Hopefully it won't have too big of an impact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm worried about that warning, but otherwise this looks good.
collect/collect.go
Outdated
if !i.IsMyTrace(trace.ID()) { | ||
err := errors.New("cannot make a decision for partial traces") | ||
|
||
i.Logger.Warn().WithFields(map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this really common? Do we actually want to be sending thousands of copies of this warning?
If we keep it, I think the error message could be clearer (what kind of decision are we trying to make?).
And finally, it's a constant string -- why construct an error out of it, and then convert it back to a string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you concern. I changed the log level to debug and the message to be more specific
Which problem is this PR solving?
If for some reason, a trace that doesn't belong to a peer in the trace cache missed its trace decision from its decider, it will stay in the cache forever.
This PR introduce a clean up mechanism for the scenario above.
Short description of the changes
filter
function insendExpiredTraces
to also return traces that have expired for too longsendExpiredTraces
behavior