-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Jetty Part#delete() implementation throws IOException #11944
Labels
Bug
For general bugs on Jetty side
Comments
Opened PR #11945 |
joakime
added a commit
that referenced
this issue
Jun 24, 2024
…-existence-check Issue #11944 - Part.delete() should only attempt to delete if the file exists
PR #11945 merged. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty version(s)
Jetty 12.0.7
Jetty Environment
ee10
Java version/vendor
(use: java -version)
java version "21.0.1" 2023-10-17 LTS
Java(TM) SE Runtime Environment (build 21.0.1+12-LTS-29)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.1+12-LTS-29, mixed mode, sharing)
OS type/version
Microsoft Windows [Version 10.0.19045.4412]
Description
Recently, we upgraded from Jetty 9.4.x to 12.0.7. We are using Spring Boot 3.2.1. After the upgrade, we noticed warnings being logged when uploading files through Jetty. The warnings are logged by the
StandardServletMultipartResolver
of Spring which tries to delete all the Parts of the multipart/form-data request after it has been handled by the application.After doing some investigation, it turns out the implementation of
jakarta.servlet.http.Part#delete()
in Jetty 12 throws an IOException if the file doesn't exist (seeorg.eclipse.jetty.http.MultiPart$Part#delete()
). In Jetty 9, this wasn't the case. In that version, aFile#exists()
check is done before the file get deleted (seeorg.eclipse.jetty.util.MultiPartInputStreamParser$MultiPart#delete()
).In our situation, we already delete these files in our application code. So it's normal that the files doesn't exist any more when the
StandardServletMultipartResolver
of Spring tries to cleanup the uploaded files. Would it be possible to add a similar file-exist check to Jetty 12 in theorg.eclipse.jetty.http.MultiPart$Part#delete()
method to avoid throwing IOExceptions for files that don't exist (any more)?The text was updated successfully, but these errors were encountered: