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-issuemaster opened this issue Dec 7, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

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:

  • #20881 PropertySourcesPlaceholderConfigurer can not ignore resource if not found

Referenced from: commits 7ad69bf, 3368dca

Backported to: 4.3.14

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 11, 2017

Brian Toal commented

Good evening,

@Juergen Hoeller any thoughts on timelines of a fix?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Dec 11, 2017

Rex Hoffman commented

Brain, see the fix version:

Fix Version/s:
4.3.14, 5.0.3

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.