andygrove opened a new pull request, #3489: URL: https://github.com/apache/datafusion-comet/pull/3489
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> N/A - debugging improvement ## Rationale for this change When debugging memory reservation issues in Comet, it is helpful to see all memory pool interactions (grow, shrink, try_grow) with task IDs and consumer names. This PR adds a lightweight opt-in logging decorator for the native memory pool. ## What changes are included in this PR? - Add new config `spark.comet.debug.memory` (default: `false`) - Add new `LoggingPool` that wraps the existing memory pool when the config is enabled - Log all `grow`, `shrink`, and `try_grow` calls with task attempt ID, consumer name, and result (Ok/Err) - Add documentation for the new debugging feature Example output: ``` [Task 486] MemoryPool[ExternalSorter[6]].try_grow(256232960) returning Ok [Task 486] MemoryPool[ExternalSorter[6]].try_grow(257820416) returning Err [Task 486] MemoryPool[ExternalSorterMerge[6]].shrink(10485760) ``` ## How are these changes tested? Manual testing with TPC-DS/TPC-H benchmarks. The logging pool is a thin decorator that delegates all operations to the underlying pool, so it does not change any behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
