-
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
12.1.0 - ResourceHandler is unable to serve content from PathResource that doesn't support mapped file buffers. #12695
Comments
The issue isn't zipfs specific, it's just the easiest way to trigger this We should also consider if a file is too small for memory mapping, per the recommendations in the javadoc linked above. "For most operating systems, mapping a file into memory is more expensive than reading or writing a few tens of kilobytes of data via the usual read and write methods. From the standpoint of performance it is generally only worth mapping relatively large files into memory." |
…orts as UnsupportedOperationException.
+ Fallback to normal filesystem read if memory mapping is not supported.
+ Add new .setUseFileMapping(boolean) flag (defaults to true) + Add test case variations for non-mapping + Fix position calculation
+ Remove useFileMapping config + Remove custom IteratingCallback + Use Content.Source.from(Path) + New InterceptorSink
…orts as UnsupportedOperationException. (#12696) * restore FileBufferedResponseHandlerTest * Remove custom IteratingCallback * Use Content.Source.from(Path) * New Interceptor based Content.Sink
Done, fixed in PR #12696 |
Jetty version(s)
12.1.0.alpha1
Jetty Environment
core
Java version/vendor
(use: java -version)
OS type/version
Linux / Ubuntu
Description
If you have a Resource Base that is a PathResource that points to a FS that doesn't support file mapping, like zipfs, then you are unable to serve files from ResourceHandler.
This works in 12.0.16 just fine.
I think the
toMappedBuffer
should catchUnsupportedOperationException
and fallback to non-mapped option.The text was updated successfully, but these errors were encountered: