<div dir="ltr">Hi, I'm testing CRaC in the context of long-running applications (e.g. streaming, continuous processing ...) and I've stumbled on an issue related to the coordination of the resolved threads. <div><br></div><div>For example, let's have a <b>Processor</b> that performs continuous computations. This processor depends on a <b>ProcessorContext</b> and later must be fully initialized before the processor can process any data.</div><div><br></div><div>When the application is first started (e.g. not from checkpoints) it ensures that the <b>ProcessorContext</b> is initialized before starting the <b>Processor</b> loop. </div><div><br></div><div>To leverage CRaC I've implemented a <b>ProcessorContextResource</b> gracefully stops the context on <b>beforeCheckpoint</b> and then re-initialized it on <b>afterRestore</b>.</div><div><br></div><div>When the checkpoint is performed, CRaC calls the <b>ProcessorContextResource.</b><b>beforeCheckpoint</b><b> </b>and also preserves the current <b>Processor</b> call stack. On Restore processor's call stack is expectedly restored at the point it was stopped but unfortunately it doesn't wait for the <b>ProcessorContextResource.</b><b>afterRestore</b> complete. This expectedly crashes the processor. </div><div><br></div>The <a href="https://github.com/tzolov/crac-demo">https://github.com/tzolov/crac-demo</a> illustreates this issue. The README explains how to reproduce the issue. The OUTPUT.md (<a href="https://github.com/tzolov/crac-demo/blob/main/OUTPUT.md">https://github.com/tzolov/crac-demo/blob/main/OUTPUT.md</a> ) offers terminal snapshots of the observed behavior. <div><br></div><div>I've used latest JDK CRaC release:</div><div>  openjdk 17-crac 2021-09-14<br>  OpenJDK Runtime Environment (build 17-crac+5-19)<br>  OpenJDK 64-Bit Server VM (build 17-crac+5-19, mixed mode, sharing)<br><div><br></div><div>As I'm new to CRaC, I'd appreciate your thoughts on this issue. </div><div><br></div><div>Cheers,</div><div>Christian</div><div><div><br></div><div><br><div><br></div></div></div></div></div>