[crac] RFR: Fix ordering of invocation on Resources [v13]

Radim Vansa duke at openjdk.org
Fri May 12 07:25:29 UTC 2023


On Thu, 11 May 2023 16:04:32 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:

>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revert removing the logging configuration
>
> I got this after some unrelated modifications (FileDescriptor.beforeCheckpoint uses lambda), and I apparently get auto-deadlock with a single thread involved:
> 
> 
> "main" #1 prio=5 os_prio=0 cpu=88.95ms elapsed=21.61s tid=0x00007fd670025160 nid=0x27228a in Object.wait()  [0x00007fd6747fd000]
>    java.lang.Thread.State: WAITING (on object monitor)
> 	at java.lang.Object.wait(java.base at 17-internal/Native Method)
> 	- waiting on <0x0000000418002088> (a jdk.internal.crac.JDKContext)
> 	at java.lang.Object.wait(java.base at 17-internal/Object.java:338)
> 	at jdk.crac.impl.AbstractContextImpl.waitWhileCheckpointIsInProgress(java.base at 17-internal/AbstractContextImpl.java:102)
> 	at jdk.crac.impl.PriorityContext.register(java.base at 17-internal/PriorityContext.java:44)
> 	- locked <0x0000000418002088> (a jdk.internal.crac.JDKContext)
> 	at jdk.internal.crac.JDKContext.register(java.base at 17-internal/JDKContext.java:97)
> 	at jdk.internal.ref.CleanerImpl$PhantomCleanableRef.<init>(java.base at 17-internal/CleanerImpl.java:170)
> 	at java.lang.ref.Cleaner.register(java.base at 17-internal/Cleaner.java:220)
> 	at java.lang.invoke.MethodHandleNatives$CallSiteContext.make(java.base at 17-internal/MethodHandleNatives.java:90)
> 	at java.lang.invoke.CallSite.<init>(java.base at 17-internal/CallSite.java:144)
> 	at java.lang.invoke.ConstantCallSite.<init>(java.base at 17-internal/ConstantCallSite.java:50)
> 	at java.lang.invoke.InnerClassLambdaMetafactory.buildCallSite(java.base at 17-internal/InnerClassLambdaMetafactory.java:270)
> 	at java.lang.invoke.LambdaMetafactory.metafactory(java.base at 17-internal/LambdaMetafactory.java:341)
> 	at java.lang.invoke.DirectMethodHandle$Holder.invokeStatic(java.base at 17-internal/DirectMethodHandle$Holder)
> 	at java.lang.invoke.Invokers$Holder.invokeExact_MT(java.base at 17-internal/Invokers$Holder)
> 	at java.lang.invoke.BootstrapMethodInvoker.invoke(java.base at 17-internal/BootstrapMethodInvoker.java:134)
> 	at java.lang.invoke.CallSite.makeSite(java.base at 17-internal/CallSite.java:315)
> 	at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(java.base at 17-internal/MethodHandleNatives.java:281)
> 	at java.lang.invoke.MethodHandleNatives.linkCallSite(java.base at 17-internal/MethodHandleNatives.java:271)
> 	at java.io.FileDescriptor$Resource.beforeCheckpoint(java.base at 17-internal/FileDescriptor.java:74)
> 	at jdk.crac.impl.PriorityContext$SubContext.invokeBeforeCheckpoint(java.base at 17-internal/PriorityContext.java:107)
> 	at jdk.crac.impl.OrderedContext.runBeforeCheckpoint(java.base at 17-in...

@AntonKozlov Please discuss the general solution in here: https://github.com/openjdk/crac/pull/66

-------------

PR Comment: https://git.openjdk.org/crac/pull/60#issuecomment-1545295344


More information about the crac-dev mailing list