Skip to content
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

Undertow - Only load resources that are known #43694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Oct 4, 2024

If we try to load every resource, we end up creating cache entries in the resourceCache CHM of the AppClassLoader, which is definitely not what we want in this case, given we are supposed to serve only known resources.

Now I must admit the fix looks a bit too simple to be true :).

Fixes #43676

If we try to load every resource, we end up creating cache entries in
the resourceCache CHM of the AppClassLoader, which is definitely not
what we want in this case, given we are supposed to serve only known
resources.

Now I must admit the fix looks a bit too simple to be true :).

Fixes quarkusio#43676
@gsmet
Copy link
Member Author

gsmet commented Oct 4, 2024

@stuartwdouglas in case you have one minute to check if what I did is right or completely wrong, that would be appreciated. It looks like an oversight but you might have had very good reasons to not do that.

Interesting context is here: #43676 (comment) .

@gsmet
Copy link
Member Author

gsmet commented Oct 4, 2024

OK, well, it doesn't look very good:

2024-10-04 11:25:20,035 ERROR [io.und.req.io] (executor-thread-1) Exception handling request b5951dd0-02d8-495a-8b76-5fcadb031235-1 to /foo/bar: java.lang.NullPointerException: Cannot invoke "java.util.Set.stream()" because "paths" is null
	at io.quarkus.undertow.test.ResourceManagerTestCase$ContextPathServlet.doGet(ResourceManagerTestCase.java:55)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:527)
	at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:614)
	at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
	at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:63)
	at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68)
	at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
	at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:67)
	at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:133)

I will have a second look after Devoxx.

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 4, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 8aa0b58.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
✔️ JVM Tests - JDK 17 Logs Raw logs 🔍
✔️ JVM Tests - JDK 21 Logs Raw logs 🔍
JVM Tests - JDK 17 Windows Build Failures Logs Raw logs 🔍

Full information is available in the Build summary check run.
You can consult the Develocity build scans.

Failures

⚙️ JVM Tests - JDK 17 Windows #

- Failing: extensions/undertow/deployment 
! Skipped: extensions/agroal/deployment extensions/cache/deployment extensions/config-yaml/deployment and 185 more

📦 extensions/undertow/deployment

io.quarkus.undertow.test.ResourceManagerTestCase.testServlet line 44 - History - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undertow CacheResourceManager can cause frequent GC
1 participant