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
Unused Narayana is started upon application start #27982
Comments
/cc @cristhiank, @gastaldi, @geoand, @gsmet |
cc @loicmathieu who added the transaction support for Mongo |
Everything works but I would argue that spending time starting unused subsystems is a "real" issue for Quarkus. |
@gsmet Here is a reproducer using Gradle. This was created by code.querkus.io, no code changes were made at all. To reproduce, start the app (I used gradle-object-store-at-quit.zip Downgrading to any 2.12 series and this behavior goes away; no directories are created at exit. |
Are you sure the transaction manager was not started? Or was it more that it wasn't logging anything so you didn't know it was started? (honest question) |
Only because in the 2.12 series no directories are created at any time and no startup messages are logged. I'm going to add Flyway to the above example and you'll see both startup log messages and the ObjectStore is created at that point rather than at exit. |
Here is Maven. It has the exact same behavior as the Gradle reproducer above. For Maven I used |
This is Maven with Flyway. I added a small simple migration. Started app using In this case you will see the Narayana/Arjuna startup messages, as well as Again, downgrading to 2.12 series and no log messages are seen nor is the |
@gsmet are you looking at this one? |
Narayana checks the transaction logs to determine whether or not there are in doubt transactions that may need to be recovered. |
I think we found a good compromise for 2.13 here: #28025 . More involved changes will have to be made in 2.14. |
Describe the bug
mongodb-panache-common
adds thenarayana-jta
extension. Although added, the transaction manager was never used and thus not started.As of
2.13.0.CR1
the transaction manager is started nearly immediately at startupExpected behavior
Narayana is not started if not used.
Additionally, it would be nice to not have it included if it's not going to be used.
Actual behavior
Narayana JTA is started almost immediately on startup.
In an application with Flyway enabled, the JTA is started prior to running migrations and a message is produced.
In applications without Flyway no message is produced but the application creates the telltale
ObjectStore
directory indicating that some portion of the JTA is starting.How to Reproduce?
Add
mongodb-panache
to an application to you'll seeObjectStore
directories.Additionally add Flyway and observe the logging related to started the JTA.
Output of
uname -a
orver
macOS 12.6
Output of
java -version
OpenJDK 17.0.1
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.13.0.CR1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.5.1
Additional information
No response
The text was updated successfully, but these errors were encountered: