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

Fix RESTEasy ImageIO leak #14700

Merged
merged 2 commits into from
Feb 1, 2021
Merged

Conversation

gsmet
Copy link
Member

@gsmet gsmet commented Jan 29, 2021

No description provided.

gsmet added 2 commits January 29, 2021 10:27
We decided to disable the IIOImageProvider in RESTEasy a long time ago
but a new method was added and it defeated this optimization.
Fix quarkusio#14674
This way, we will have a GraalVM error if a new method makes use of it
instead of silently including ImageIO.
@jerboaa
Copy link
Contributor

jerboaa commented Jan 29, 2021

This looks good to me. I've confirmed on a local build of quarkus 1.11 with this patch, non-graphics apps no longer pull in that stack for no reason.

@gsmet
Copy link
Member Author

gsmet commented Jan 29, 2021

Thanks for confirming @jerboaa !

@zakkak
Copy link
Contributor

zakkak commented Jan 29, 2021

@gsmet this indeed fixes the issue for most tests but we still see issues on the following tests:

  • quarkus-integration-test-main-999-SNAPSHOT-runner
  • quarkus-integration-test-hibernate-orm-panache-999-SNAPSHOT-runner
  • quarkus-integration-test-spring-web-999-SNAPSHOT-runner
  • quarkus-integration-test-liquibase-999-SNAPSHOT-runner
  • quarkus-integration-test-tika-999-SNAPSHOT-runner

IT main (which includes ImageIOTestCase) and IT tika are known to have dependencies on AWT, but what about the rest?
Can someone confirm whether they really depend on graph libraries?

@jerboaa
Copy link
Contributor

jerboaa commented Jan 29, 2021

When debugging quarkus-integration-test-spring-web ImageIO class gets loaded via AnalysisMethod com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$10.parse. That turns out to be coming from:
lib/org.glassfish.jaxb.jaxb-runtime-2.3.3-b02.jar Once you find where the source code of that actually is we arrive here:
https://github.com/eclipse-ee4j/jaxb-ri/blob/2.3.3-b01-RI-RELEASE/jaxb-ri/runtime/impl/src/main/java/com/sun/xml/bind/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java#L48

Is this expected?

@jerboaa
Copy link
Contributor

jerboaa commented Jan 29, 2021

I'm guessing it's a different issue, but causing a similar problem.

@gsmet
Copy link
Member Author

gsmet commented Feb 1, 2021

As for the rest of the problematic tests, it looks like they all depend on JAXB explicitly and I think the behavior was probably preexisting.

Note that even for RESTEasy, that might be something we would want to reconsider now that we have proper ImageIO support. The provider detection works well IF the consumes/produces are properly defined and in this case, the provider is not included.

We didn't have any report asking for this support so far so we can keep it like that for now but that's something we might reconsider later.

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.

5 participants