-
Notifications
You must be signed in to change notification settings - Fork 307
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
HPCC-32924 Override OTel TlsRandomNumberGenerator #19630
base: candidate-9.10.x
Are you sure you want to change the base?
HPCC-32924 Override OTel TlsRandomNumberGenerator #19630
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32924 Jirabot Action Result: |
@ghalliday I'm not a proponent of copying the random.h classes into jlib, but I'm illustrating the obstacle we're facing if we want to patch our own version of TlsRandomNumberGenerator since it's not included in their header package. Our CustomIdGenerator could use a different random number generator. |
system/jlib/jtrace.cpp
Outdated
opentelemetry::trace::SpanId GenerateSpanId() noexcept override | ||
{ | ||
uint8_t span_id_buf[trace_api::SpanId::kSize]; | ||
NotSharedOTelRandom::GenerateRandomBuffer(span_id_buf); |
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.
Instead of mimicking OTel's default behavior, we're free to introduce any other random data generator here
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.
Yes. The otel random number generation structure seems unnecessarily complicated and inefficient, particularly their use of static variables. and multiple classes.
I think the 3 random number generator classes could be combined into one (a static accessor function) and then member functions to fill in the buffer. There are other things that could be made more efficient.
I would start by rationalizing the class structure.
f242b8a
to
ac0e8f9
Compare
@ghalliday please take a look at the proposed changes |
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.
@rpastrana looks good. Please squash and remove the commented out code.
- Defines custom ID Generator based on overwritten random number generator logic - Avoids fork related random number logic issues Signed-off-by: Rodrigo Pastrana <[email protected]>
ac0e8f9
to
fce71e8
Compare
@ghalliday comments removed and commits squashed |
Type of change:
Checklist:
Smoketest:
Testing: