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 ClassLoader leak of ActivityCorrelator ThreadLocal #2366

Merged
merged 3 commits into from
Mar 27, 2024
Merged

Conversation

lilgreenbird
Copy link
Contributor

address issue reported in #2136 where ActivityCorrelator ThreadLocal never being removed from the thread.

@lilgreenbird lilgreenbird added this to the 12.7.0 milestone Mar 25, 2024
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 50.15%. Comparing base (8e92248) to head (892ef1a).
Report is 2 commits behind head on main.

❗ Current head 892ef1a differs from pull request most recent head e6b3e5f. Consider uploading reports for the commit e6b3e5f to get more accurate results

Files Patch % Lines
.../microsoft/sqlserver/jdbc/SQLServerConnection.java 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2366      +/-   ##
============================================
+ Coverage     50.10%   50.15%   +0.04%     
- Complexity     3813     3823      +10     
============================================
  Files           145      145              
  Lines         33286    33299      +13     
  Branches       5639     5641       +2     
============================================
+ Hits          16677    16700      +23     
- Misses        14221    14240      +19     
+ Partials       2388     2359      -29     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tkyc
tkyc previously approved these changes Mar 26, 2024
Jeffery-Wasty
Jeffery-Wasty previously approved these changes Mar 26, 2024
@lilgreenbird lilgreenbird dismissed stale reviews from Jeffery-Wasty and tkyc via e6b3e5f March 26, 2024 21:42
@lilgreenbird lilgreenbird changed the title Fix ClassLoader leak Fix ClassLoader leak of ActivityCorrelator ThreadLocal Mar 26, 2024
@lilgreenbird lilgreenbird merged commit f626adf into main Mar 27, 2024
17 checks passed
@lilgreenbird lilgreenbird deleted the threadlocal branch April 3, 2024 00:45
dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Aug 3, 2024
…QLServer docker image tag to `2022-CU14-ubuntu-22.04`

### What changes were proposed in this pull request?

This PR aims to upgrade `mssql-jdbc` to 12.8.0.jre11 and MySQLServer docker image to `mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04`.

### Why are the changes needed?

This is the latest stable version of `mssql-jdbc`,  related release notes:

https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.0
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.1
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.8.0

Some fixed issues:

- Fix to ensure metadata returned follows JDBC data type specs microsoft/mssql-jdbc#2326
- Added token cache map to fix use of unintended auth token for subsequent connections microsoft/mssql-jdbc#2341
- Clear prepared statement handle before reconnect microsoft/mssql-jdbc#2364
- Reset socketTimeout to original value after a successful connection open microsoft/mssql-jdbc#2355
- Clear prepared statement cache when resetting statement pool connection microsoft/mssql-jdbc#2361
- Fixed ClassLoader leak of ActivityCorrelator ThreadLocal microsoft/mssql-jdbc#2366

### Does this PR introduce _any_ user-facing change?

No.
### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes #47569 from wayneguow/ms_12_8.

Authored-by: Wei Guo <guow93@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
fusheng9399 pushed a commit to fusheng9399/spark that referenced this pull request Aug 6, 2024
…QLServer docker image tag to `2022-CU14-ubuntu-22.04`

### What changes were proposed in this pull request?

This PR aims to upgrade `mssql-jdbc` to 12.8.0.jre11 and MySQLServer docker image to `mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04`.

### Why are the changes needed?

This is the latest stable version of `mssql-jdbc`,  related release notes:

https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.0
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.1
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.8.0

Some fixed issues:

- Fix to ensure metadata returned follows JDBC data type specs microsoft/mssql-jdbc#2326
- Added token cache map to fix use of unintended auth token for subsequent connections microsoft/mssql-jdbc#2341
- Clear prepared statement handle before reconnect microsoft/mssql-jdbc#2364
- Reset socketTimeout to original value after a successful connection open microsoft/mssql-jdbc#2355
- Clear prepared statement cache when resetting statement pool connection microsoft/mssql-jdbc#2361
- Fixed ClassLoader leak of ActivityCorrelator ThreadLocal microsoft/mssql-jdbc#2366

### Does this PR introduce _any_ user-facing change?

No.
### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#47569 from wayneguow/ms_12_8.

Authored-by: Wei Guo <guow93@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
attilapiros pushed a commit to attilapiros/spark that referenced this pull request Oct 4, 2024
…QLServer docker image tag to `2022-CU14-ubuntu-22.04`

### What changes were proposed in this pull request?

This PR aims to upgrade `mssql-jdbc` to 12.8.0.jre11 and MySQLServer docker image to `mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04`.

### Why are the changes needed?

This is the latest stable version of `mssql-jdbc`,  related release notes:

https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.0
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.1
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.8.0

Some fixed issues:

- Fix to ensure metadata returned follows JDBC data type specs microsoft/mssql-jdbc#2326
- Added token cache map to fix use of unintended auth token for subsequent connections microsoft/mssql-jdbc#2341
- Clear prepared statement handle before reconnect microsoft/mssql-jdbc#2364
- Reset socketTimeout to original value after a successful connection open microsoft/mssql-jdbc#2355
- Clear prepared statement cache when resetting statement pool connection microsoft/mssql-jdbc#2361
- Fixed ClassLoader leak of ActivityCorrelator ThreadLocal microsoft/mssql-jdbc#2366

### Does this PR introduce _any_ user-facing change?

No.
### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#47569 from wayneguow/ms_12_8.

Authored-by: Wei Guo <guow93@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
himadripal pushed a commit to himadripal/spark that referenced this pull request Oct 19, 2024
…QLServer docker image tag to `2022-CU14-ubuntu-22.04`

### What changes were proposed in this pull request?

This PR aims to upgrade `mssql-jdbc` to 12.8.0.jre11 and MySQLServer docker image to `mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04`.

### Why are the changes needed?

This is the latest stable version of `mssql-jdbc`,  related release notes:

https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.0
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.7.1
https://github.com/microsoft/mssql-jdbc/releases/tag/v12.8.0

Some fixed issues:

- Fix to ensure metadata returned follows JDBC data type specs microsoft/mssql-jdbc#2326
- Added token cache map to fix use of unintended auth token for subsequent connections microsoft/mssql-jdbc#2341
- Clear prepared statement handle before reconnect microsoft/mssql-jdbc#2364
- Reset socketTimeout to original value after a successful connection open microsoft/mssql-jdbc#2355
- Clear prepared statement cache when resetting statement pool connection microsoft/mssql-jdbc#2361
- Fixed ClassLoader leak of ActivityCorrelator ThreadLocal microsoft/mssql-jdbc#2366

### Does this PR introduce _any_ user-facing change?

No.
### How was this patch tested?

Pass GA.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#47569 from wayneguow/ms_12_8.

Authored-by: Wei Guo <guow93@gmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

4 participants