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

Deprecate spring-context-indexer #30431

Closed
snicoll opened this issue May 5, 2023 · 14 comments
Closed

Deprecate spring-context-indexer #30431

snicoll opened this issue May 5, 2023 · 14 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented May 5, 2023

The Spring Context indexer was introduced as a way to process component scanning of very large applications at build-time. It comes with several limitations, the biggest one being an on/off switch (i.e. as soon as one metadata file is present, all jar files must have been processed with the tool or matching beans won't be found).

In the meantime, our AOT efforts in Spring Framework 6 covers those performance and build-time optimization aspects in a much broader fashion. As we don't intend to further explore the route of the indexer, we're going to deprecate it in favor of AOT.

@mitasov-ra
Copy link

Does Spring AOT imply GraalVM usage?

@snicoll
Copy link
Member Author

snicoll commented May 5, 2023

No.

@snicoll snicoll self-assigned this May 8, 2023
@vpavic
Copy link
Contributor

vpavic commented May 11, 2023

It's a shame to see the indexer deprecated (and eventually removed) since it was quite useful in some situations and provided measurable gains during startup.

For older (and larger) applications I don't know how feasible will it be to move to AOT - I would even say that the type of applications that benefited the most from the indexer are the ones least likely to adopt AOT. But also with the new applications I personally don't like being forced to adopt AOT to have optimization of this kind at disposal.

Did indexer incur so much maintenance cost?

@snicoll
Copy link
Member Author

snicoll commented May 11, 2023

It's not so much the maintenance cost, but rather the fact that the indexer has serious limitations and we know we won't be resolving them. I can see how that can be annoying if it is working fine for you as it is, but, as maintainers, we have to strike a balance between "competing" options, the message it sends and the confusion it could bring.

AOT is not set in stone, far from it. It would be interesting to see how it could be used to handle what the indexer used to do, with less optimizations and therefore more flexibility at runtime.

That being said, we can't remove the indexer before 7.0 at the earliest. We're monitoring this issue and we'll review our position before M1 if necessary.

@jhoeller jhoeller changed the title Deprecate spring context indexer Deprecate spring-context-indexer Jun 3, 2023
@vpavic
Copy link
Contributor

vpavic commented Jun 13, 2023

FWIW, it seems to me that support for JVM Checkpoint Restore (using CRaC) is perhaps better suited to be considered as the feature that context indexer is deprecated in favor of, simply because it allows developers to continue building their applications as they are used to (unlike AOT).

@sdeleuze
Copy link
Contributor

CRaC has great benefits, but I think it introduces more constraints than AOT (some like fixed application context being common), and has a different nature, so I tend to agree with the line of thinking that AOT is conceptually the successor of the context indexer.

mdeinum pushed a commit to mdeinum/spring-framework that referenced this issue Jun 29, 2023
This commit deprecates the context indexer as our efforts on the AOT
engine cover the indexer in a much broader fashion.

Closes spring-projectsgh-30431
@shodo

This comment was marked as resolved.

@bclozel

This comment was marked as outdated.

@shodo

This comment was marked as resolved.

@shodo

This comment was marked as resolved.

@bclozel
Copy link
Member

bclozel commented Sep 25, 2023

@shodo the sample application is quite complex and there are a lot of moving parts. The problem might be in the build configuration itself. I'm moving this to a new issue #31307 as it's not related to this particular issue.

ascopes added a commit to ascopes/java-compiler-testing that referenced this issue Dec 2, 2023
ascopes added a commit to ascopes/java-compiler-testing that referenced this issue Dec 2, 2023
@ascopes
Copy link
Contributor

ascopes commented Dec 4, 2023

@snicoll Unless I misunderstand...

At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM. We intend to support more JVM-based use cases in future generations.

Doesn't this imply you do need GraalVM currently?

@sbrannen
Copy link
Member

sbrannen commented Dec 4, 2023

Doesn't this imply you do need GraalVM currently?

No. Previously the "focus" was primarily for use with a GraalVM native image, but it was always possible to use Spring AOT on the JVM, and Spring Framework 6.1 and future generations will provide more first-class support for JVM-based use cases such as CDS (class data sharing), Project Leyden, etc.

Though, you're right: the wording in that note in the reference manual could be improved to make this clearer.

@ascopes, would you like to open an issue to address that topic?

@ascopes
Copy link
Contributor

ascopes commented Dec 4, 2023

Thanks for the quick response!

I'll have to see if I have some time at the weekend to throw something together, but happy to take a look!

candrews added a commit to candrews/jumpstart that referenced this issue Feb 4, 2024
spring-context-indexer is deprecated.

See: spring-projects/spring-framework#30431
candrews added a commit to candrews/jumpstart that referenced this issue Feb 4, 2024
spring-context-indexer is deprecated.

See: spring-projects/spring-framework#30431
Devhunter416 pushed a commit to Devhunter416/jumpstart that referenced this issue Mar 6, 2024
spring-context-indexer is deprecated.

See: spring-projects/spring-framework#30431
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

8 participants