hiero-ledger / hiero-ledger/hiero-consensus-node
Teacher sometimes uses a mutable copy of the state
- Dominant language
- Java
- Stars
- 406
- Forks
- 226
- Avg merge
- 3d 4h
- Merged PRs (30d)
- 210
Description
A few test failures have been observed recently, very intermittent. Symptoms are:
```
17:24:54.407 504466 exception on thread
java.lang.IllegalStateException: detach is only allowed on immutable copies
at com.swirlds.virtualmap@0.67.0-SNAPSHOT/com.swirlds.virtualmap.VirtualMap.detach(VirtualMap.java:1146)
at com.swirlds.virtualmap@0.67.0-SNAPSHOT/com.swirlds.virtualmap.internal.pipeline.VirtualPipeline.pausePipelineAndExecute(VirtualPipeline.java:613)
at com.swirlds.virtualmap@0.67.0-SNAPSHOT/com.swirlds.virtualmap.internal.pipeline.VirtualPipeline.pausePipelineAndRun(VirtualPipeline.java:360)
at com.swirlds.virtualmap@0.67.0-SNAPSHOT/com.swirlds.virtualmap.internal.reconnect.TeacherPushVirtualTreeView.lambda$new$0(TeacherPushVirtualTreeView.java:153)
at java.base/java.lang.Thread.run(Thread.java:1583)
```
It looks like there is a thread race somewhere in the state lifecycle code, which leads to the mutable copy to be used by reconnect teacher. It should never happen, teacher can only work with an immutable (and hashed) copy.
Contributor guide
Assessment
This issue has not been assessed yet.