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

Cache: fix CacheInterceptor in case of non-ArC interceptor bindings #43832

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

Commits on Oct 11, 2024

  1. Cache: fix CacheInterceptor in case of non-ArC interceptor bindings

    RESTEasy Classic's MP RestClient implementation produces annotations
    at runtime, so they are not created by ArC and therefore don't extend
    `AbstractAnnotationLiteral`. At the same time, that implementation
    produces an `ArcInvocationContext` and puts interceptor bindings
    into its context map under the ArC key.
    
    Some places may expect that an `ArcInvocationContext` would always
    contain ArC-created `AbstractAnnotationLiteral` instances, but alas,
    per the description above, that is not the case.
    
    There are multiple options for fixing that collision. My preferred one
    would be to get rid of `AbstractAnnotationLiteral` and treat all
    annotations uniformly. That unfortunately has negative performance
    implications on the `CacheInterceptor`, so is not an option yet [1].
    
    This commit chooses another path: it modifies the only place in Quarkus
    that actually depends on `AbstractAnnotationLiteral` to check whether
    the `Set<AbstractAnnotationLiteral>` actually contains instances of
    `AbstractAnnotationLiteral`. I hope that before more places in Quarkus
    start depending on `AbstractAnnotationLiteral`, we can get rid of it.
    
    This commit only checks the first annotation in the set, because
    if the bindings come from RESTEasy Classic, then none of them are
    instances of `AbstractAnnotationLiteral`, and if they come from ArC,
    then all of them are instances of `AbstractAnnotationLiteral`.
    
    [1] The performance issue (JDK-8180450) is fixed in JDK 23 and has
        not been backported to any LTS release as of this writing.
    Ladicek committed Oct 11, 2024
    Configuration menu
    Copy the full SHA
    6a4fbd6 View commit details
    Browse the repository at this point in the history