-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Closed as not planned
Closed as not planned
Copy link
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withstatus: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: bugA general bugA general bug
Description
Spring will override the Netty leak detection level set using -Dio.netty.leakDetection.level=advanced
The code below want to set leak detection if property was not null. But the property has default value as SIMPLE. This will get leak detection overridden as SIMPLE always if you set it other value like 'advanced' outside of Spring
public class NettyProperties {
private LeakDetection leakDetection = LeakDetection.SIMPLE;
...
public class NettyAutoConfiguration {
public NettyAutoConfiguration(NettyProperties properties) {
if (properties.getLeakDetection() != null) {
NettyProperties.LeakDetection leakDetection = properties.getLeakDetection();
ResourceLeakDetector.setLevel(ResourceLeakDetector.Level.valueOf(leakDetection.name()));
}
}
}
...changed to
if (properties.getLeakDetection() != LeakDetection.SIMPLE) {
will solve the problem as LeakDetection will be simple if not set.
Happy to raise a PR if this is
Version: current main branch
Metadata
Metadata
Assignees
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withstatus: supersededAn issue that has been superseded by anotherAn issue that has been superseded by anothertype: bugA general bugA general bug