Huaisi Xu has submitted this change and it was merged.

Change subject: IMPALA-2711: Fix memory leak in Rand().
......................................................................


IMPALA-2711: Fix memory leak in Rand().

MathFunctions::RandPrepare() allocates a 4-bytes seed and
stores it in the FunctionContext's thread local state.
However, it was never freed. This change fixes the problem
by adding a close function for Rand() so it has a chance to
free the seed. A new test is also added to verify the fix.

Change-Id: Ibcc2e1ca0d052b86defe80aad471f9fdaac5a453
Reviewed-on: http://gerrit.cloudera.org:8080/1855
Reviewed-by: Michael Ho <[email protected]>
Tested-by: Internal Jenkins
(cherry picked from commit 2c637b21bbcd76aa49560e0fce4411fdc5f86be9)
Reviewed-on: http://gerrit.cloudera.org:8080/2638
Reviewed-by: anujphadke <[email protected]>
Tested-by: Huaisi Xu <[email protected]>
---
M be/src/exprs/math-functions.cc
M be/src/exprs/math-functions.h
M common/function-registry/impala_functions.py
M testdata/workloads/functional-query/queries/QueryTest/create.test
4 files changed, 29 insertions(+), 5 deletions(-)

Approvals:
  Huaisi Xu: Verified
  anujphadke: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/2638
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcc2e1ca0d052b86defe80aad471f9fdaac5a453
Gerrit-PatchSet: 2
Gerrit-Project: Impala
Gerrit-Branch: cdh5-2.2.0_5.4.x
Gerrit-Owner: Huaisi Xu <[email protected]>
Gerrit-Reviewer: Huaisi Xu <[email protected]>
Gerrit-Reviewer: Internal Jenkins
Gerrit-Reviewer: Michael Ho <[email protected]>
Gerrit-Reviewer: anujphadke <[email protected]>

Reply via email to