+1 Thanks ZhangJian He
On Tue, 21 Feb 2023 at 10:08, Hang Chen <chenh...@apache.org> wrote: > +1 for Yong's suggestion. > > Thanks, > Hang > > Yan Zhao <horizo...@apache.org> 于2023年2月20日周一 16:55写道: > > > > > According to the original PR's motivation > > > <https://github.com/apache/bookkeeper/pull/1754>, we wrapped a Netty > > > allocator > > > and want to configure something through bookkeeper. > > > So the user will use our customized allocator and need to obey the > rules > > > we introduced. Then the Netty's configuration > `io.netty.leakDetection.level` > > > seems useless for us. I think they would never have a chance to take it > > > differently. > > > > > > We defined a new configuration property to configure the > > > LeakDetectionPolicy. > > > > > > > > > > > > > > > *public LeakDetectionPolicy getAllocatorLeakDetectionPolicy() { > > > return LeakDetectionPolicy > > > .valueOf(this.getString(ALLOCATOR_LEAK_DETECTION_POLICY, > > > LeakDetectionPolicy.Paranoid.toString())); }* > > > > > > Some users may don't know the `*ALLOCATOR_LEAK_DETECTION_POLICY`* > > > and only configure* `*io.netty.leakDetection.level` to open the leak > > > detection. > > > I would suggest getting both `*ALLOCATOR_LEAK_DETECTION_POLICY`* > > > and `io.netty.leakDetection.level` from the system property, use the > highest > > > policy of it. And then, no matter how you configured it, the detection > > > policy always worked. > > > > Agree. >