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

Unnecessary file system access in SimpleMetadataReaderFactory.getMetadataReader [SPR-16281] #20828

Closed
spring-projects-issues opened this issue Dec 7, 2017 · 5 comments
Assignees
Labels
in: core status: backported type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 7, 2017

Rex Hoffman opened SPR-16281 and commented

Instead of eagerly checking the file exists with "if (!resource.exists())" perhaps move the logic into the metadata reader only attempt the rewrite if the access has failed with the passed in name?

We can provide a patch if needed.


Affects: 4.3.6, 4.3.14

Reference URL: https://github.com/spring-projects/spring-framework/blob/master/spring-core/src/main/java/org/springframework/core/type/classreading/SimpleMetadataReaderFactory.java#L80-L90

Issue Links:

Referenced from: commits 7ad69bf, 3368dca

Backported to: 4.3.14

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 11, 2017

Brian Toal commented

Good evening,

@Juergen Hoeller any thoughts on timelines of a fix?

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 11, 2017

Rex Hoffman commented

Brain, see the fix version:

Fix Version/s:
4.3.14, 5.0.3

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 11, 2017

Brian Toal commented

Apologies Juergen, I missed the "fixed version" and wasn't aware when that version is available. Rex filled me in on and offline.

Thanks for looking at this!

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 7, 2018

Juergen Hoeller commented

We're optimistically trying the standard resource path now, catching FileNotFoundException now and only trying the inner class variant then.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jan 8, 2018

Rex Hoffman commented

This fix looks perfect for our use case. Would you like us to get timings, or is the feedback sufficient?

@spring-projects-issues spring-projects-issues added type: bug status: backported in: core labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 5.0.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core status: backported type: bug
Projects
None yet
Development

No branches or pull requests

2 participants