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
I have my own custom console app that is using the Class NeoSystem. When i'm importing blocks; I ctrl+C to shutdown the app, while its processing the blocks. When i do so i get the error below. The way i import blocks is the same way you do it in the neo-cli source.
This isn't really a big problem for me. Doesn't affect anything for me. Just thought you should know.
System.InvalidOperationException: Cannot create child while terminating or terminated
at Akka.Actor.ActorCell.MakeChild(Props props, String name, Boolean async, Boolean systemService)
at Akka.Actor.ActorCell.AttachChild(Props props, Boolean isSystemService, String name)
at Akka.Actor.Internal.ActorSystemImpl.SystemActorOf(Props props, String name)
at Akka.Actor.Inbox.Create(ActorSystem system)
at Neo.NeoSystem.EnsureStopped(IActorRef actor)
at Neo.NeoSystem.Dispose()
To Reproduce
Steps to reproduce the behavior:
public async Task StartAsync(CancellationToken cancellationToken)
{
_neosystem ??= new NeoSystem(_protocolsettings, Settings.Current.Storage.Engine, string.Format(Settings.Current.Storage.Path, _protocolsettings.Network.ToString("X8")));
LocalNode = _neosystem.LocalNode.Ask<LocalNode>(new LocalNode.GetInstance(), cancellationToken: cancellationToken).Result;
_logger.LogInformation("Neo system local node created.");
var cancel = new CancellationTokenSource();
_cancelbroadcast ??= new();
_braodcastpingtask = Task.Run(async () => await Broadcast(_cancelbroadcast), cancellationToken);
Task showStateTask = Task.Run(async () => await ShowState(cancel), cancellationToken);
using (IEnumerator<Block> blocksBeingImported = GetBlocksFromFile().GetEnumerator())
{
while (true)
{
List<Block> blocksToImport = new();
for (int i = 0; i < 10; i++)
{
if (!blocksBeingImported.MoveNext()) break;
blocksToImport.Add(blocksBeingImported.Current);
}
if (blocksToImport.Count == 0) break;
await _neosystem.Blockchain.Ask<Blockchain.ImportCompleted>(new Blockchain.Import
{
Blocks = blocksToImport,
Verify = true,
}, cancellationToken: cancellationToken);
if (_neosystem is null) return;
}
}
cancel.Cancel();
try { showStateTask.Wait(cancellationToken); } catch { }
_logger.LogInformation("Neo system import completed.");
_neosystem.StartNode(new ChannelsConfig
{
Tcp = new IPEndPoint(IPAddress.Any, Settings.Current.P2P.Port),
WebSocket = new IPEndPoint(IPAddress.Any, Settings.Current.P2P.WsPort),
MinDesiredConnections = Settings.Current.P2P.MinDesiredConnections,
MaxConnections = Settings.Current.P2P.MaxConnections,
MaxConnectionsPerAddress = Settings.Current.P2P.MaxConnectionsPerAddress
});
_logger.LogInformation("Neo system node started.");
}
public Task StopAsync(CancellationToken cancellationToken)
{
_cancelbroadcast?.Cancel();
try { _braodcastpingtask.Wait(cancellationToken); } catch { }
_cancelbroadcast?.Dispose();
_neosystem?.Dispose();
_cancelbroadcast = null;
_neosystem = null;
return Task.CompletedTask;
}
Expected behavior
The "Neo.NeoSystem.EnsureStopped(IActorRef actor)" function check for application terminating or terminated and handle it by shutting down the Akka. Seeing how the neo-cli is a console app the problem could come up down the road(in future release).
Screenshots
Platform:
OS: Windows 10 Pro x64 21H2 19044.2728 (Windows Feature Experience Pack 120.2212.4190.0)
Version Neo 3.5.0, Dotnet 7.0.202
The text was updated successfully, but these errors were encountered:
Describe the bug
I have my own custom console app that is using the Class NeoSystem. When i'm importing blocks; I ctrl+C to shutdown the app, while its processing the blocks. When i do so i get the error below. The way i import blocks is the same way you do it in the neo-cli source.
This isn't really a big problem for me. Doesn't affect anything for me. Just thought you should know.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The "Neo.NeoSystem.EnsureStopped(IActorRef actor)" function check for application terminating or terminated and handle it by shutting down the Akka. Seeing how the neo-cli is a console app the problem could come up down the road(in future release).
Screenshots

Platform:
The text was updated successfully, but these errors were encountered: