-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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(otel): use BatchQueue
to avoid worker-level table data race
#9504
Conversation
82068cd
to
ae92250
Compare
Oops, thanks for fixing the title typo @sumimakito (*´∇`*) |
|
||
spans_queue[len] = pb_span | ||
spans_queue.n = len | ||
insert(spans_queue, pb_span) |
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 might be slow as table length is actually relatively expensive to calculate in Lua. It is common to store the length of the array in spans_queue[0]
and then do the previous logic instead.
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.
Thanks for noticing, used BatchQueue
to replace the worker-level cache table. I have an idea that only the privileged worker handles the queue and sends requests; the other workers insert data into the queue through the new events library. That could reduce the performance impact on normal workers.
Discussed with @mayocream we will need more work to properly fix this issue, thus moving out of 3.01 scope |
23d2cf2
to
553fae9
Compare
BatchQueue
to avoid worker-level table data race
75fce4c
to
b978858
Compare
Summary
Fix an issue where OpenTelemetry spans are randomly stripped and not sent to the backend.