GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing github.com — Remove OpenSslEngineMap and DefaultOpenSslEngineMap by doom369 · Pull Request #15444 · netty/netty Conversation
Contributor
Motivation: DefaultOpenSslEngineMap is just a wrapper around concurrent hash map that has no value, but adds additional allocation and unnecressary abstraction levels. Modification: Removed Result: No more
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Strange, I just saw that this api is used in native calls, but not a single test failed. It's not covered with test or not used? Please feel free to close. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@doom369 huh ? Where is it used in a native call ? I should be used by java methods that are called from native code but that's it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@normanmaurer here for example:
While |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@doom369 thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Motivation: ReferenceCountedOpenSslContext strongly references every engine through its `engines` map (the SSL* -> engine reverse lookup used by the OpenSSL callbacks). As an SslContext is typically a long-lived singleton, a leaked engine stays reachable for the context's whole lifetime, so OpenSslEngine.finalize() - the backstop meant for that case - never runs and its native memory is freed only when the context is destroyed. Modification: Reintroduce OpenSslEngineMap as a class holding the engines as WeakReferences. A live engine is always strongly reachable via its SslHandler, so only a leaked one becomes collectable. The abstraction removed in #15444 was a strong wrapper that rightly added no value; weak values give it a reason to exist. Add OpenSslEngineTest.leakedEngineIsReclaimedWhileContextAlive. Result: A leaked OPENSSL engine is reclaimed per-engine independently of its context. For OPENSSL_REFCNT a leaked engine now also becomes collectable, so the ResourceLeakDetector reports it instead of it being pinned silently.
…17204) Auto-port of #17199 to 5.0 Cherry-picked commit: 26255b1 --- Motivation: ReferenceCountedOpenSslContext strongly references every engine through its `engines` map (the SSL* -> engine reverse lookup used by the OpenSSL callbacks). As an SslContext is typically a long-lived singleton, a leaked engine stays reachable for the context's whole lifetime, so OpenSslEngine.finalize() - the backstop meant for that case - never runs and its native memory is freed only when the context is destroyed. Modification: Reintroduce OpenSslEngineMap as a class holding the engines as WeakReferences. A live engine is always strongly reachable via its SslHandler, so only a leaked one becomes collectable. The abstraction removed in #15444 was a strong wrapper that rightly added no value; weak values give it a reason to exist. Add OpenSslEngineTest.leakedEngineIsReclaimedWhileContextAlive. Result: A leaked OPENSSL engine is reclaimed per-engine independently of its context. For OPENSSL_REFCNT a leaked engine now also becomes collectable, so the ResourceLeakDetector reports it instead of it being pinned silently. Co-authored-by: Bryce Anderson <[email protected]>
Motivation: ReferenceCountedOpenSslContext strongly references every engine through its `engines` map (the SSL* -> engine reverse lookup used by the OpenSSL callbacks). As an SslContext is typically a long-lived singleton, a leaked engine stays reachable for the context's whole lifetime, so OpenSslEngine.finalize() - the backstop meant for that case - never runs and its native memory is freed only when the context is destroyed. Modification: Reintroduce OpenSslEngineMap as a class holding the engines as WeakReferences. A live engine is always strongly reachable via its SslHandler, so only a leaked one becomes collectable. The abstraction removed in #15444 was a strong wrapper that rightly added no value; weak values give it a reason to exist. Add OpenSslEngineTest.leakedEngineIsReclaimedWhileContextAlive. Result: A leaked OPENSSL engine is reclaimed per-engine independently of its context. For OPENSSL_REFCNT a leaked engine now also becomes collectable, so the ResourceLeakDetector reports it instead of it being pinned silently. (cherry picked from commit 26255b1) This also backports #15444 which is harmless because neither of those types are public. --------- Co-authored-by: Bryce Anderson <[email protected]>
…etty#17205) Motivation: ReferenceCountedOpenSslContext strongly references every engine through its `engines` map (the SSL* -> engine reverse lookup used by the OpenSSL callbacks). As an SslContext is typically a long-lived singleton, a leaked engine stays reachable for the context's whole lifetime, so OpenSslEngine.finalize() - the backstop meant for that case - never runs and its native memory is freed only when the context is destroyed. Modification: Reintroduce OpenSslEngineMap as a class holding the engines as WeakReferences. A live engine is always strongly reachable via its SslHandler, so only a leaked one becomes collectable. The abstraction removed in netty#15444 was a strong wrapper that rightly added no value; weak values give it a reason to exist. Add OpenSslEngineTest.leakedEngineIsReclaimedWhileContextAlive. Result: A leaked OPENSSL engine is reclaimed per-engine independently of its context. For OPENSSL_REFCNT a leaked engine now also becomes collectable, so the ResourceLeakDetector reports it instead of it being pinned silently. (cherry picked from commit 26255b1) This also backports netty#15444 which is harmless because neither of those types are public. --------- Co-authored-by: Bryce Anderson <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.