[JIRA] (HSEARCH-4712) Convert synchronized blocks to java.util.concurrent.Locks for better Loom compatibility
by Yoann Rodière (JIRA)
Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *updated* an issue
Hibernate Search ( https://hibernate.atlassian.net/browse/HSEARCH?atlOrigin=eyJpIjoiNjY1ODVi... ) / Improvement ( https://hibernate.atlassian.net/browse/HSEARCH-4712?atlOrigin=eyJpIjoiNjY... ) HSEARCH-4712 ( https://hibernate.atlassian.net/browse/HSEARCH-4712?atlOrigin=eyJpIjoiNjY... ) Convert synchronized blocks to java.util.concurrent.Locks for better Loom compatibility ( https://hibernate.atlassian.net/browse/HSEARCH-4712?atlOrigin=eyJpIjoiNjY... )
Change By: Yoann Rodière ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
See [https://hibernate.atlassian.net/browse/HHH-15541|https://hibernate.atlass...], apparently some synchronized blocks cause problems with Loom by “pinning threads”.
What that means exactly is secondary, I think; the important part is that migrating from synchronized blocks to locks should be trivial, so we might as well do it.
So, let’s remove the problematic synchronized blocks from non-test code, and use locks instead.
WARNING: I’m not sure which synchronized blocks are problematic exactly, it would seem that some {{synchronized}} uses are fine (such as the {{synchronized}} modifier on a method, and _maybe_ {{synchronized(this)}} inside a method) while others are definitely problematic ({{synchronized(someOtherObject)}}). See [https://hibernate.zulipchat.com/#narrow/stream/132094-hibernate-orm-dev/t...] . We'll need some research to determine precise rules.
Also, while we’re at it, we should probably add a checkstyle rule to forbid problematic synchronized blocks (and suggest using locks instead, with a link to this ticket).
( https://hibernate.atlassian.net/browse/HSEARCH-4712#add-comment?atlOrigin... ) Add Comment ( https://hibernate.atlassian.net/browse/HSEARCH-4712#add-comment?atlOrigin... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100207- sha1:b857cee )
2 years, 2 months