hiero-ledger / hiero-ledger/hiero-consensus-node

Teacher sometimes uses a mutable copy of the state

Open
#21,131 0 comments 0 reactions 1 assignee Claimed by @imalygin View on GitHub
Platform Platform Reconnect
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.