-
Notifications
You must be signed in to change notification settings - Fork 32
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
When does the "Incorrect span sent" error occur? #235
Comments
We were able to come up with a way to reproduce this. The error happens when initialization is interrupted for nested spans - after current_span is updated and before the children list is updated Here's some code that repros the issue in honeycomb-beeline v2.8.1: class Honeycomb::Span
def create_child
self.class.new(trace: trace,
builder: builder,
context: context,
parent: self,
parent_id: id,
sample_hook: sample_hook,
presend_hook: presend_hook,
propagation_hook: propagation_hook).tap do |c|
# adding a sleep to make the repro more reliable
sleep(2)
children << c
end
end
end
a = Thread.new do
Honeycomb.start_span(name: "outer-span") do |span|
Honeycomb.start_span(name: "inner-span") do |span|
end
end
end
sleep(1)
a.raise Exception |
Can you say more about "fairly consistently"? Does the error occur on every execution of the job? Every time to job fails? On a consistent time interval?
Yes, one way that the latest span in the context ( |
We've seen it often during shutdown routines, e.g. when sidekiq raises an exception to all of its threads. |
Ah, I see. Yes, any time exceptions are injected from outside a thread, the risk increases for timing problems. The Beeline maintains state for a trace to control the timing of sends and to apply trace-level fields. Exceptions injected from outside of the current thread introduce race conditions for the maintenance of this state. Handling injected exceptions gets tricky—some maintainers of threaded Ruby processes believe it is futile to try—so I cannot currently picture any changes we would make to the Beeline to address this that wouldn't also break backwards compatibility. Have you considered migrating off the Beeline and onto OpenTelemetry Ruby? |
Gotcha, thanks for the reply! I believe we've determined that the error is benign for our side, and so we're not urgently trying to fix it anymore. Will take a look at OpenTelemetry Ruby – thanks for the rec! (also not sure the etiquette here, but I closed this thread since my question has been answered!) |
Hi!
My company is using Honeycomb with ActiveJob to track job spans. We've recently run into an issue where a certain job is fairly consistently raising an
Incorrect span sent
error, and I'm curious under what situations this error comes up.The code snippet from our override of ActiveJob's
perform_now
:The error comes right at the beginning in
Honeycomb.start_span(name: "jobs.#{self.class.name}")
and traces back to this line in the honeycomb library.Would appreciate any insight or pointers on where I should look next! Also let me know if there's any additional context I can provide that would help.
The text was updated successfully, but these errors were encountered: