-
Notifications
You must be signed in to change notification settings - Fork 244
chore: Add memory reservation debug logging and visualization #2521
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
base: main
Are you sure you want to change the base?
Conversation
debug_native: jboolean, | ||
explain_native: jboolean, | ||
tracing_enabled: jboolean, |
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.
rather than adding yet another flag to this API call, I am now using the already available spark config map in native code.
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.
+1. The config map should be the preferred method
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2521 +/- ##
============================================
+ Coverage 56.12% 59.01% +2.88%
- Complexity 976 1457 +481
============================================
Files 119 146 +27
Lines 11743 13569 +1826
Branches 2251 2358 +107
============================================
+ Hits 6591 8008 +1417
- Misses 4012 4340 +328
- Partials 1140 1221 +81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
impl MemoryPool for LoggingPool { | ||
fn grow(&self, reservation: &MemoryReservation, additional: usize) { | ||
println!( |
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.
should be println
as info!
or trace!
?
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 guess info!
would be ok. I pushed that change. If we use trace!
then we would have to set spark.comet.debug.memory=true
and also configure trace logging for this one file, which seem like overkill for a debug feature
debug_native: jboolean, | ||
explain_native: jboolean, | ||
tracing_enabled: jboolean, |
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.
+1. The config map should be the preferred method
|
||
impl MemoryPool for LoggingPool { | ||
fn grow(&self, reservation: &MemoryReservation, additional: usize) { | ||
info!( |
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.
Would it be useful to add a debug! log message which has the backtrace of where this was requested from?
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.
Good idea. I updated try_grow
to log the Err
if it fails. This should contain the backtrace if the backtrace feature is enabled, but I need to test this out locally.
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 was thinking that we do this for every call (not just for the error) so we can trace the precise origins of the allocations. Probably should be a trace message (not a debug) though. This is merely a suggestion though, I'll leave it to you to decide if it is useful.
Logging the backtrace on error is definitely useful.
moving to draft while I work on the Python scripts |
Which issue does this PR close?
Closes #.
Rationale for this change
Debugging.
From this, we can make pretty charts to help with comprehension:
What changes are included in this PR?
spark.comet.debug.memory
LoggingPool
that is enabled when the new config is setHow are these changes tested?