简体   繁体   中英

Azure Service Fabric - Delete Actor with custom Service

I'm having hard times with Actor delete. I've created custom base service to enable backup on my Actor System bu unfortunately having Task.Delay() inside RunAsync forbid me from actor delete (DeleteActorAsync hangs).

My RunAsync in custom service have simple construction:

protected override async Task RunAsync(CancellationToken cancellationToken)
{
    await Task.Delay(500, cancellationToken);
}

That's it. When I remove delay and replace with standard base.RunAsync() actor delete runs with no problems.

Can anybody suggest something? I'm unable to find anything usable in documentation.

I've managed to find issue in ActorService source code (although it was already in code remarks of ActorService.RunAsync()).

You have to run base.RunAsync(...) if you override this in custom implementation :)

protected override async Task RunAsync(CancellationToken cancellationToken)
{
    await base.RunAsync(cancellationToken);
    await Task.Delay(500, cancellationToken);
}

That's all. Everything now works perfectly!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM