oracle / ojdbc-extensions

The Oracle JDBC Driver Extensions include providers for centralized configuration or token providers for authentication with the DB.
Universal Permissive License v1.0
13 stars 5 forks source link

Address possible thread leak with OCI Java SDK until we can upgrade to 3.37.0 #69

Closed psilberk closed 6 months ago

psilberk commented 7 months ago

Following the issue reported in OCI Java SDK slack channel (see below for full detail, compromised versions and workaround). Proposed solution:

Rakesh Kumar 6 days ago @here @channel my apologies for the wide notification. The OCI SDKs team needs you to know about a possible thread leak with the OCI Java SDK. If you do not use the OCI Java SDK anywhere in your service, you can ignore this message. To resolve this issue: set the system property oci.javasdk.apache.idle.connection.monitor.thread.enabled to false to disable IdleConnectionMonitor thread. OR update your service to use OCI Java SDK version: If you are using any of the below mentioned 2.x versions then update to 2.67.1 or newer (or 2.67.1-preview1-SNAPSHOT if using preview SDK) and close the client as mentioned below. If you are using any of the below mentioned 3.x versions then update to 3.34.1 or newer (or 3.34.1-preview1-SNAPSHOT if using preview SDK) and close the client as mentioned below. Once you update to the newer version, you can close the thread by calling close() or create the client in a try-with-resources block so it calls closes automatically when done.. For example: try (client = new Client) { ... } or client.close() Note: The system property works on all the affected versions and the newer Java SDK versions. The OCI Java SDK versions mentioned below, has an issue with thread leak in the new IdleConnectionMonitor. This is the kind of issue which might not have been caught in your testing, but could happen in your production environment, especially if your service runs for an extended period. If you consume the OCI Java SDK through the oci-internal-bom , these versions of the BOM are affected: 2.0.192 through 3.0.197. The following OCI Java SDK versions are affected by this issue: 2.66.2 2.67.0 3.31.0 3.31.1 3.32.0 3.32.1 3.33.0 3.34.0 2.66.1-preview1-SNAPSHOT 2.66.2-preview1-SNAPSHOT 2.66.3-preview1-SNAPSHOT 3.30.1-preview1-SNAPSHOT 3.31.1-preview1-SNAPSHOT 3.31.2-preview1-SNAPSHOT 3.32.1-preview1-SNAPSHOT 3.32.2-preview1-SNAPSHOT 3.33.1-preview1-SNAPSHOT We are still working on a way to resolve the issue without making changes to the code, You can track it here DEX-19655. (edited)