ARTEMIS-5013 do not override Netty leak detection

do not override the configured netty leak detection from client code.
Use the same logic as server, disabling the default only if no
properties are configured in the JVM.
See 127ce3a84a
This commit is contained in:
fogninid 2024-08-26 19:34:27 +01:00 committed by Justin Bertram
parent f9b912baf0
commit 9aa089b78b
1 changed files with 4 additions and 2 deletions

View File

@ -172,8 +172,10 @@ public class NettyConnector extends AbstractConnector {
public static final Map<String, Object> DEFAULT_CONFIG;
static {
// Disable resource leak detection for performance reasons by default
ResourceLeakDetector.setLevel(Level.DISABLED);
// Disable default Netty leak detection if the Netty leak detection level system properties are not in use
if (System.getProperty("io.netty.leakDetectionLevel") == null && System.getProperty("io.netty.leakDetection.level") == null) {
ResourceLeakDetector.setLevel(Level.DISABLED);
}
// Set default Configuration
Map<String, Object> config = new HashMap<>();