-
Notifications
You must be signed in to change notification settings - Fork 3.8k
TRUNK-6302: Setup Infinispan backend for Hibernate/Spring caching #5027
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
base: master
Are you sure you want to change the base?
Conversation
@rkorytkowski do you also get these build failures locally? |
It works for me, but it may be failing due to its async nature. I'll work
on a fix.
…On Sat, May 10, 2025, 22:52 dkayiwa ***@***.***> wrote:
*dkayiwa* left a comment (openmrs/openmrs-core#5027)
<#5027 (comment)>
@rkorytkowski <https://github.com/rkorytkowski> do you also get these
build failures locally?
—
Reply to this email directly, view it on GitHub
<#5027 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAI37FIRIGJEDC2CY6ZBGZL25ZRJBAVCNFSM6AAAAAB4Y7ZZK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQNRZGE2DSNZVHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Looking forward to it! |
69157d0
to
1ba6bec
Compare
I'm a bit blocked on these failures... I cannot reproduce them locally for some reason... @dkayiwa could you please run it locally and see if it fails for you? If so I'll ask you to run it with logging set to DEBUG for org.hibernate and org.infinispan in src/test/resources/log4j2.xml. Ideally run a single failing test. |
I see there's also an issue with Java 24...
Not sure if it can be fixed without upgrading infinispan, which would necessitate upgrading Hibernate... @wikumChamith any quick ideas? |
This was deprecated in Java 23+. You might be able to work around it by passing some JVM arguments to allow the security manager however, that won't be a proper fix. |
The failures are a bit random. In one instance i got this: https://pastebin.com/wAyvaFsu and details: https://pastebin.com/tdygXL49 |
When i run a single test like this from the api folder: |
This is the failure log with |
This is the log with |
And this is the log when both hibernate and infinispan and turned to DEBUG: |
Thanks @dkayiwa! Which JDK you use? Maybe I'll be able to reproduce using the same one. Meanwhile I'll dig through the logs. |
This is the output of my
|
Okay it's Oracle... I'll try that. I'm using Temurin which is theoretically same as on GHA, but tests do not fail for me at all... The issue is very strange... in your logs I see Adding entity to second-level cache: [org.openmrs.PersonName#8] and hibernate stats show that cache is being populated and used... with cache hits. |
The test failure also happens on Temurin
|
858f6dc
to
7224b06
Compare
Context.getPersonService().getPersonName(PERSON_NAME_ID_2); | ||
assertThat(sf.getStatistics().getSecondLevelCacheHitCount(), is(hitCount)); | ||
Context.getPersonService().getPersonName(PERSON_NAME_ID_8); | ||
assertThat(sf.getStatistics().getSecondLevelCacheHitCount(), is(greaterThan(hitCount))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewritten the test to not use sf.getCache() as it doesn't seem to reflect reliably all changes happening behind the scenes with Hibernate + Infinispan.
log.error(ex.getMessage(), ex); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Infinispan caches should be properly shutdown by Spring and Hibernate shutdown methods...
Interestingly when I switched from Java 8 to 21 Temurin it started to fail for me as well. The issue was that SessionFactory#getCache was not reliably showing the current state of the cache... It seemed like some sort of not synchronized view in multi-threaded execution. Relying on hibernate stats instead fixed the test. |
Oh i see! |
Windows fails... fun continues :/ |
At first i thought that probably GitHub just forgot to rerun it after your fix. 😊 |
Description of what I changed
Issue I worked on
see https://issues.openmrs.org/browse/TRUNK-6302
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amend
I have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amend
I ran
mvn clean package
right before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master