-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
Issues like #15045 are caused because some query execution paths are not instrumented to capture thread usage. When instrumentation is turned on NPE is caused. Since it is not possible to guarantee that all execution paths are covered, add a null check before sampling for resource usage. Bonus points if the data has a marker that a code path was not instrumented.
Specifically, change
if (_isThreadMemorySamplingEnabled) {
_threadLocalEntry.get()._currentThreadMemoryAllocationSampleBytes
= getThreadResourceUsageProvider().getThreadAllocatedBytes();
}
to
if (_isThreadMemorySamplingEnabled && getThreadResourceUsageProvider() != null) {
_threadLocalEntry.get()._currentThreadMemoryAllocationSampleBytes
= getThreadResourceUsageProvider().getThreadAllocatedBytes();
}
This will improve the confidence in the feature because queries will continue to work and not error out with NPE. The only possible concern is perf impact due to the extra check.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels