Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Dec 5, 2025

Cherry-picked from #58574

…8574)

## Problem
JNI Global References may not be deleted when `JdbcConnector::close()`
fails
midway due to early returns from `RETURN_IF_ERROR` macros. This prevents
Java
GC from collecting `BaseJdbcExecutor` and its associated `ResultSet`
objects,
  causing old generation heap to grow to 99%+.

  ## Solution
- C++: Always delete all three Global References regardless of Java
close() failure
- Java: Always clear member variable references (`resultSet`, `stmt`,
`conn`) in finally block
@github-actions github-actions bot requested a review from morrySnow as a code owner December 5, 2025 06:03
@Thearas
Copy link
Contributor

Thearas commented Dec 5, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@dataroaring dataroaring closed this Dec 5, 2025
@dataroaring dataroaring reopened this Dec 5, 2025
@Thearas
Copy link
Contributor

Thearas commented Dec 5, 2025

run buildall

@morrySnow morrySnow merged commit 9aff673 into branch-3.1 Dec 5, 2025
21 of 22 checks passed
@morrySnow morrySnow deleted the auto-pick-58574-branch-3.1 branch December 5, 2025 10:22
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.

5 participants