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
Describe the bug
When we shut down the neo-node by Ctrl-C or exit command or any other unexpected method, we will probably lose one block's data for every IPersistencePlugin if it's syncing block and using OnCommit() for data recording. If OnPersist() is used for data recording, no data will be lost while an exception will be thrown.
Background
We're trying to build an archive node by adding an IPersistencePlugin that records all data at any block height. When we add the Dispose method, the DB will always meet a segmentation fault when we stop the neo-node.
To Reproduce
Steps to reproduce the behavior:
Open the neo-node, install any IPersistencePlugin with Dispose() method that releases the essential resouces.
Run ./neo-node
Type exit after it starts syncing block
Expected behavior
The plugin will cause an exception because of using resources after releasing them.
Screenshots
at Neo.Plugins.Storage.Store.Put(Byte[] key, Byte[] value)
at Neo.Plugins.ArchiveStore.<>c__DisplayClass3_0.<OnPersist>b__0(Trackable v)
at System.Collections.Generic.List`1.ForEach(Action`1 action)
at Neo.Plugins.ArchiveStore.OnPersist(NeoSystem ns, Block block, DataCache snapshot, IReadOnlyList`1 ae)
at Neo.Ledger.Blockchain.Persist(Block block)
at Neo.Ledger.Blockchain.OnImport(IEnumerable`1 blocks, Boolean verify)
at Akka.Actor.UntypedActor.Receive(Object message)
at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
at Akka.Actor.ActorCell.ReceiveMessage(Object message)
at Akka.Actor.ActorCell.Invoke(Envelope envelope)
at Akka.Dispatch.Mailbox.ProcessMailbox(Int32 left, Int64 deadlineTicks)
at Akka.Dispatch.Mailbox.ProcessMailbox()
at Akka.Dispatch.Mailbox.<Run>b__36_0()
at Akka.Actor.ActorCell.UseThreadContext(Action action)
at Akka.Dispatch.Mailbox.Run()
at Akka.Dispatch.ThreadPoolExecutorService.<>c.<.cctor>b__3_0(Object t)
at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
[1] 56384 segmentation fault ./neo-cli
Expected code
Move EnsureStoped(LocalNode); before plugins' Dispose().
At least make sure all IPersistencePlugins dispose after the LocalNode is stoped.
Maybe ApplicationLogs Plugin can add the Dispose() method to release DB safely after this issue is solved.
The text was updated successfully, but these errors were encountered:
Describe the bug
When we shut down the neo-node by Ctrl-C or
exit
command or any other unexpected method, we will probably lose one block's data for everyIPersistencePlugin
if it's syncing block and usingOnCommit()
for data recording. IfOnPersist()
is used for data recording, no data will be lost while an exception will be thrown.Background
We're trying to build an archive node by adding an
IPersistencePlugin
that records all data at any block height. When we add theDispose
method, the DB will always meet a segmentation fault when we stop the neo-node.To Reproduce
Steps to reproduce the behavior:
IPersistencePlugin
withDispose()
method that releases the essential resouces../neo-node
exit
after it starts syncing blockExpected behavior
The plugin will cause an exception because of using resources after releasing them.
Screenshots
neo/src/neo/NeoSystem.cs
Lines 164 to 174 in d092510
Expected code
Move
EnsureStoped(LocalNode);
before plugins'Dispose()
.At least make sure all
IPersistencePlugin
s dispose after the LocalNode is stoped.Maybe ApplicationLogs Plugin can add the
Dispose()
method to release DB safely after this issue is solved.The text was updated successfully, but these errors were encountered: