Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
The memory usage stats for an operator in a query profile may not be up to date, even after the query is completed. This is caused by two possible issues:
1 Memory usage is polled by a thread once every 5 seconds. However the final memory usage of the operator may not be reported if the operator completes before the next polling cycle.
2 There is a race condition in the Foreman where one thread sets the metrics on an object and another thread reads the metrics object to include in a query profile. The thread that reads the metrics object may read old metrics since access to the variable is not synchronized.
There are two fixes for this
1 Poll the stats one more time after the fragment root completes but before the operator is closed.
2 Synchronize the methods on the FragmentData class.