You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered a possible livelock with FST, which occurs on a single thread without any concurrency in play.
It is triggered by a combination of nested FST-use and class-initialization, and basically results in a deadlock of a thread running on 100% CPU, busy-waiting for itself indefinitely.
The (sole) main thread will hang in following busy-lock-acquire of FSTClazzInfoRegistry.getCLInfo():
while(!rwLock.compareAndSet(false,true));
What happens here to trigger the issue:
Deserialization of an enum constant with FST, for which the enum-class has not yet been initialized (I can't reproduce the same issue with a regular class instead of an enum)
The initialization of that enum-class triggers another, nested FST-related operation (serialization or deserialization) somewhere, on the same coder instance (doesn't matter on what sort of class this nested operation is done, AFAICS)
The self-serialization of E1 in its constructor in the example is quite artificial and just done to keep the snippet small; in real life this could be anything done by the <clinit> of the enum and its constants - like some static final field which triggers some other FST-call somewhere further down the line, in some other class.
The problem does not manifest if the nested use of FST is using a separate coder instance.
FST version this happens with: 3.0.4-jdk17
The text was updated successfully, but these errors were encountered:
Encountered a possible livelock with FST, which occurs on a single thread without any concurrency in play.
It is triggered by a combination of nested FST-use and class-initialization, and basically results in a deadlock of a thread running on 100% CPU, busy-waiting for itself indefinitely.
Fairly minimal snippet where this happens:
The (sole)
main
thread will hang in following busy-lock-acquire ofFSTClazzInfoRegistry.getCLInfo()
:What happens here to trigger the issue:
The self-serialization of E1 in its constructor in the example is quite artificial and just done to keep the snippet small; in real life this could be anything done by the
<clinit>
of the enum and its constants - like some static final field which triggers some other FST-call somewhere further down the line, in some other class.The problem does not manifest if the nested use of FST is using a separate coder instance.
FST version this happens with: 3.0.4-jdk17
The text was updated successfully, but these errors were encountered: