New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Why is MemoryFileUpload not released by DefaultHttpDataFactory? #8640
Comments
@jameskleeh sorry for the late response... This may be a bug. Are you interested in providing a PR ? |
@normanmaurer Sure thing |
@normanmaurer Done #9672 |
@jameskleeh Indeed, that was intentional. Maybe wrongly, since you feel it should be included... |
@fredericBregier Sure thing |
@fredericBregier I don't see what comments you are referring to. Can you point me in the right direction? |
Sure: netty/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpDataFactory.java Line 75 in c70254e
netty/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpDataFactory.java Line 80 in c70254e
netty/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpData.java Line 121 in c70254e
(even if this one was already wrong, since in AbstractMemoryHttpData, the delete method indeed call release on bytebuf) I don't go everywhere, but I think this are the main ones. Of course, we might also add a new method Line 660 in c70254e
since it now will delete all, even not files, in order to be clean (even if cleanFile will delete all). Or just changing the associated comment to ensure the new behavior is understood. And same on Line 949 in c70254e
|
I've updated the Javadocs to what makes sense to me. I didn't add |
Expected behavior
I expect any MemoryFileUploads to be released when any of the cleanAll methods are called
Actual behavior
Mixed and Disk uploads are cleaned, but memory isn't. This seems intentional as the same logic is applied to attributes.
The upload/attributes are never added to the list that gets iterated over when cleaning
https://github.com/netty/netty/blob/4.1/codec-http/src/main/java/io/netty/handler/codec/http/multipart/DefaultHttpDataFactory.java#L245
Netty version
4.1.30
JVM version (e.g.
java -version
)Java 8
OS version (e.g.
uname -a
)macOS
The text was updated successfully, but these errors were encountered: