-
Notifications
You must be signed in to change notification settings - Fork 285
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
CA-386582: Always create exporting thread for observers #5294
CA-386582: Always create exporting thread for observers #5294
Conversation
Xapi_stdext_threads.Threadext.Mutex.execute lock (fun () -> | ||
match !exporter_created with | ||
| None -> | ||
let tid = create_exporter () in |
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.
We are creating an exporter - but assign to a tid
- which is a thread ID? Naming could be more congruent such that the function creating a value is related to the variable holding that value. We have here exporter_created
, create_exporter
and tid
which refer to related values but you can't tell this from their names.
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.
tid is the thread id of the exporter, it is a temporary variable holding the value of that id. It's just easier to have this temporary variable rather than storing the value in exporter directly, which can be a bit awkward since it is a option value, and what we want to return is the actual value without the option
7209431
to
053b9b2
Compare
Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
Previously the exporting thread for observer is only created when there is an observer stored in the database associated with a component. This is not the original intent of how observers should be used. We want to create the exporting thread regardless of whether we have any observers so that when observers are created later on, their spans can be exported, since creating an observer will not check for the existence of an exporting thread. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
This allows the observer to be created _after_ clusterd has been started. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
0ac4492
to
f36ae95
Compare
create observer exporting thread regardless of whether we have observers in database.