-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix](jdbc) Fix JNI global reference leak in JdbcConnector close #58574
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
TPC-H: Total hot run time: 33974 ms |
TPC-DS: Total hot run time: 181893 ms |
ClickBench: Total hot run time: 27.4 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
morningman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…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
…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
…ache#58574) ## 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
Problem
JNI Global References may not be deleted when
JdbcConnector::close()failsmidway due to early returns from
RETURN_IF_ERRORmacros. This prevents JavaGC from collecting
BaseJdbcExecutorand its associatedResultSetobjects,causing old generation heap to grow to 99%+.
Solution
resultSet,stmt,conn) in finally block