RFR: 8287104: AddressChangeListener thread inherits CCL and can cause memory leak for webapp-servers [v3]

Jaikiran Pai jpai at openjdk.java.net
Wed May 25 09:30:46 UTC 2022


> Can I please get a review of this change which addresses https://bugs.openjdk.java.net/browse/JDK-8287104?
> 
> The change in this commit now uses an `InnocuousThread` to create a thread with `null` context classloader. The `Runnable` task of this thread just invokes a native method through JNI to be notified of IP addresses change of the host. As such any specific thread context classloader isn't necessary in this thread.
> 
> Additionally, this commit does some minor changes like making the `lock` member variable `final` and also marking the `changed` member variable as `volatile`. These changes aren't necessary for this fix, but I think would be good to have while we are changing this part of the code.
> 
> Finally, the thread that we create here, now has a specific name `Net-address-change-listener` instead of the usual system wide auto-generated name.
> 
> No new tests have been added for this change. Existing tier1, tier2 and tier3 tests have been run and no related failures have been noticed.

Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:

  No need for volatile as spotted by Daniel

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/8827/files
  - new: https://git.openjdk.java.net/jdk/pull/8827/files/f1f4a7a5..6d36b16c

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8827&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8827&range=01-02

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8827.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8827/head:pull/8827

PR: https://git.openjdk.java.net/jdk/pull/8827


More information about the net-dev mailing list