You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "sullis (via GitHub)" <gi...@apache.org> on 2024/03/29 18:51:12 UTC
[PR] NIFI-12977: enable Netty leak detector extension [nifi]
sullis opened a new pull request, #8585:
URL: https://github.com/apache/nifi/pull/8585
<!-- Licensed to the Apache Software Foundation (ASF) under one or more -->
<!-- contributor license agreements. See the NOTICE file distributed with -->
<!-- this work for additional information regarding copyright ownership. -->
<!-- The ASF licenses this file to You under the Apache License, Version 2.0 -->
<!-- (the "License"); you may not use this file except in compliance with -->
<!-- the License. You may obtain a copy of the License at -->
<!-- http://www.apache.org/licenses/LICENSE-2.0 -->
<!-- Unless required by applicable law or agreed to in writing, software -->
<!-- distributed under the License is distributed on an "AS IS" BASIS, -->
<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
<!-- See the License for the specific language governing permissions and -->
<!-- limitations under the License. -->
# Summary
[NIFI-12977](https://issues.apache.org/jira/browse/NIFI-12977)
# Tracking
Please complete the following tracking steps prior to pull request creation.
### Issue Tracking
- [ ] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
### Pull Request Tracking
- [ ] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
- [ ] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
### Pull Request Formatting
- [ ] Pull Request based on current revision of the `main` branch
- [ ] Pull Request refers to a feature branch with one commit containing changes
# Verification
Please indicate the verification steps performed prior to pull request creation.
### Build
- [ ] Build completed using `mvn clean install -P contrib-check`
- [ ] JDK 21
### Licensing
- [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
- [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
### Documentation
- [ ] Documentation formatting appears as expected in rendered files
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12977: enable Netty leak detector extension [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory closed pull request #8585: NIFI-12977: enable Netty leak detector extension
URL: https://github.com/apache/nifi/pull/8585
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12977: enable Netty leak detector extension [nifi]
Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on PR #8585:
URL: https://github.com/apache/nifi/pull/8585#issuecomment-2027863339
Thanks for the updates @sullis, and thanks for evaluating the functionality @joewitt.
Although detecting resource leaks is an important part of developing with Netty, I agree with @joewitt that the failure messages are too generic to be useful under the circumstances.
With general efforts to reduce the dependency footprint of Apache NiFi over the last year, any new dependency needs to be evaluated carefully. If the error reporting were more fine-grained, or if it detected some existing issues, that might be more of a reason for inclusion.
As it stands however, I am a -1 and will close the PR for now. If new versions of the library are capable of more fine-grained error detection, this could be worth revisiting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12977: enable Netty leak detector extension [nifi]
Posted by "joewitt (via GitHub)" <gi...@apache.org>.
joewitt commented on PR #8585:
URL: https://github.com/apache/nifi/pull/8585#issuecomment-2027764212
`[ERROR] Tests run: 12, Failures: 0, Errors: 6, Skipped: 0, Time elapsed: 1.175 s <<< FAILURE! -- in org.apache.nifi.processors.opentelemetry.ListenOTLPTest
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest.testPostProtobuf -- Time elapsed: 0.018 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: after [testPostProtobuf()] [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterEach(NettyLeakDetectorExtension.java:70)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest.testRequiredProperties -- Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:20)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.beforeEach(NettyLeakDetectorExtension.java:77)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Suppressed: java.lang.IllegalStateException: Netty leaks: after [testRequiredProperties()] [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterEach(NettyLeakDetectorExtension.java:70)
... 2 more
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest.testPostJsonPartialSuccess -- Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:20)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.beforeEach(NettyLeakDetectorExtension.java:77)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Suppressed: java.lang.IllegalStateException: Netty leaks: after [testPostJsonPartialSuccess()] [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterEach(NettyLeakDetectorExtension.java:70)
... 2 more
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest.testPostPathNotFound -- Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:20)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.beforeEach(NettyLeakDetectorExtension.java:77)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Suppressed: java.lang.IllegalStateException: Netty leaks: after [testPostPathNotFound()] [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterEach(NettyLeakDetectorExtension.java:70)
... 2 more
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest.testGetMethodNotAllowed -- Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:20)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.beforeEach(NettyLeakDetectorExtension.java:77)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Suppressed: java.lang.IllegalStateException: Netty leaks: after [testGetMethodNotAllowed()] [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterEach(NettyLeakDetectorExtension.java:70)
... 2 more
[ERROR] org.apache.nifi.processors.opentelemetry.ListenOTLPTest -- Time elapsed: 1.175 s <<< ERROR!
java.lang.IllegalStateException: Netty leaks: [ByteBuf]
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:31)
at io.github.nettyplus.leakdetector.junit.NettyLeakListener.assertZeroLeaks(NettyLeakListener.java:20)
at io.github.nettyplus.leakdetector.junit.NettyLeakDetectorExtension.afterAll(NettyLeakDetectorExtension.java:57)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ListenOTLPTest » IllegalState Netty leaks: [ByteBuf]
[ERROR] ListenOTLPTest.testGetMethodNotAllowed » IllegalState Netty leaks: [ByteBuf]
[ERROR] ListenOTLPTest.testPostJsonPartialSuccess » IllegalState Netty leaks: [ByteBuf]
[ERROR] ListenOTLPTest.testPostPathNotFound » IllegalState Netty leaks: [ByteBuf]
[ERROR] ListenOTLPTest.testPostProtobuf » IllegalState Netty leaks: after [testPostProtobuf()] [ByteBuf]
[ERROR] ListenOTLPTest.testRequiredProperties » IllegalState Netty leaks: [ByteBuf]`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12977: enable Netty leak detector extension [nifi]
Posted by "sullis (via GitHub)" <gi...@apache.org>.
sullis commented on PR #8585:
URL: https://github.com/apache/nifi/pull/8585#issuecomment-2027733126
> Is there a particular issue you noticed when enabling this extension?
I have not noticed any Netty resource leaks. The goal of this PR is to prevent future resource leaks.
Perhaps I should have put the Leak Detector extension on the ListenOLTPTest class.
I pushed an update that modifies ListenOLTPTest.java
<img width="397" alt="image" src="https://github.com/apache/nifi/assets/30938/4e34fb47-0455-4123-a963-648ed31666c2">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] NIFI-12977: enable Netty leak detector extension [nifi]
Posted by "joewitt (via GitHub)" <gi...@apache.org>.
joewitt commented on PR #8585:
URL: https://github.com/apache/nifi/pull/8585#issuecomment-2027769891
To try and cause something to output I added a line into one of the OTEL tests to just create a ByteBuf and leave it alone. And indeed the tests started failing. I then released the ByteBuf and indeed the tests again works. However, they didn't make it clear which test had the issue and it isn't the one listed in the above output. So as a general alerting perhaps that is helpful but in finding the core issue it didn't seem particularly helpful.
Notably a full clean build with all the checks still works. The full system tests still work. So to a certain sense this might give some added confidence about handling ByteBuf in the case of Netty well. But we have a lot of cases of resource leak concerns and this only covers one. For the most part our code reviews should consider such things.
That said - I'm not confident pulling in this dependency and adding to these tests like this is currently warranted. Our otel stuff for instance doesn't appear to make the byte buffers itself but rather the underlying library seems to. If so that is the thing which should have such checks. I might be wrong on that but worth noting.
I'm a -0 on this change as it stands.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org