-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Hot reload breaks when using suspending functions in controller with Quarkus security #35478
Comments
/cc @sberyozkin (security) |
Hey @michalvavrik @mkouba Does it ring any bell ? |
I'm no Kotlin expert but the error message is clear that "Kotlin
I don't think that the
Yes, because Quarkus security is implemented with CDI interceptors. But any interceptor would cause the same problem though. |
I do not really understand, probably because I don't know how Quarkus hot-reload works under the hood. It should be noted that other interceptors (not sure if it is CDI or not) appear to work correctly with
However, the live reload works correctly with that interceptor (and not using security). |
I'm not sure about Kotlin but the regular Java classes are recompiled when modified in the dev mode. @evanchooly do you have an idea if the
What interceptors do you have in mind? |
In that case, if the
The one I posted above, I guess it is the |
I don't know how all that is set up. I thought it was designed to delegate to the build tool and simply reload the new class files. |
@FredyH
@evanchooly There is the CompilationProvider abstraction and the KotlinCompilationProvider seems to be using Kotlin CLI and the plugins should be taken into account 🤷. |
Except that |
@aloubyansky @gsmet Do you happen to know if the plugins defined in the |
I did some more testing with However, it should be noted that this only happens when the method is suspending. Changing a regular method that is not explicitly open, but rather only open because of the It should be noted that suspend functions actually compile down to functions that are different than what is declared (taking a continuation and all), so maybe the issue somehow arises from that. |
They are not, only |
Here is how compiler options are meant to be configured https://quarkus.io/guides/kotlin#configuring-live-reload-compiler |
I have just started experimenting with Quarkus and Kotlin and this error bugged me. Adding custom annotation to classes and allOpen plugin didn't help. What worked for me is just add |
@sharubhat for what I remember when I stopped looking into it, this whole issue only happens when plugins are not configured as described in https://quarkus.io/guides/kotlin#configuring-live-reload-compiler. Please let me know if that impression is wrong, I could look again. |
That did not help me. It just removed the stack trace from logs but the responses continued to error out. |
Noted, thanks. |
@michalvavrik Do you look into this? We are also very interested that this bug get fixed because we are migration to Gradle. |
similar issue #29875 |
I've found a workaround: #37109 (comment) |
Thank you so much! Confirming that this works. |
Describe the bug
When editing a suspending function in a Jakarta resource that is protected by Quarkus security (for example with the
@PermitAll
annotation), the reload will error and yield the following exceptionIntercepted methods of the bean org.acme.ExampleResource may not be declared final:
This is likely due to the
all-open
plugin not being taken into account properly/too late.It should be noted that the recompilation works fine if Quarkus security is not used.
Expected behavior
Live reload works correctly and new code is used
Actual behavior
Compilation error:
Intercepted methods of the bean org.acme.ExampleResource may not be declared final:
How to Reproduce?
Reproducer: suspending-reproducer.zip
Steps:
ExampleResource::hello
Output of
uname -a
orver
Microsoft Windows [Version 10.0.22621.2134]
Output of
java -version
17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.4.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.1.1
Additional information
No response
The text was updated successfully, but these errors were encountered: