Skip to content
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

Fix for cache reference leak warning #3161

Open
wants to merge 22 commits into
base: BABEL_4_X_DEV
Choose a base branch
from

Conversation

pranavJ23
Copy link
Contributor

@pranavJ23 pranavJ23 commented Nov 25, 2024

Description

Problem: During the Alter function/procedure we are doing a sys-cache search without releasing it.
Fix: was to do sys-cache search via tuple and releasing it after the sys-cache search.
Also we are generating the logfile but the path that we were giving it github action workflow was not correct, updated that too.

Issues Resolved

[BABEL-5551]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the Apache 2.0 and PostgreSQL licenses, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@coveralls
Copy link
Collaborator

coveralls commented Nov 25, 2024

Pull Request Test Coverage Report for Build 12886386243

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 6 of 7 (85.71%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 74.932%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/pl_handler.c 6 7 85.71%
Totals Coverage Status
Change from base Build 12805407769: 0.001%
Covered Lines: 46962
Relevant Lines: 62673

💛 - Coveralls

@pranavJ23 pranavJ23 changed the title [OSS ONLY] Fix to throw error instead of warning in JDBC test logfile Fix for cache reference leak warning Jan 17, 2025
@pranavJ23 pranavJ23 requested a review from tanscorpio7 January 17, 2025 12:54
Signed-off-by: pranav jain <[email protected]>
Signed-off-by: pranav jain <[email protected]>
Signed-off-by: pranav jain <[email protected]>
@pranavJ23 pranavJ23 requested a review from sumitj824 January 21, 2025 11:55
if(get_bbf_function_tuple_from_proctuple(SearchSysCache1(PROCOID, ObjectIdGetDatum(oldoid))) == NULL)
proctup = SearchSysCache1(PROCOID, ObjectIdGetDatum(oldoid));

if (proctup == NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use HeapTupleIsValid & curly braces can be removed in next line.

if (get_bbf_function_tuple_from_proctuple(proctup) == NULL)
{
/* Release the tuple before reporting the error */
ReleaseSysCache(proctup);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of error we do not need to release syscache

Signed-off-by: pranav jain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants