Skip to content

Client doesn't stop properly on .NET Core #80

Closed
@abdullin

Description

@abdullin

When shutting down the system, FoundationDB client tries to stop the network thread by aborting it. That isn't supported on .NET Core (at least on my mac), resulting in an exception:

Unhandled Exception: System.PlatformNotSupportedException: Thread abort is not supported on this platform.
   at System.Threading.Thread.Abort()
   at FoundationDB.Client.Fdb.StopEventLoop() in /Users/rinat/proj/fdb-layers/dotnet/foundationdb-dotnet-client/FoundationDB.Client/Fdb.cs:line 282
   at FoundationDB.Client.Fdb.Stop() in /Users/rinat/proj/fdb-layers/dotnet/foundationdb-dotnet-client/FoundationDB.Client/Fdb.cs:line 741
   at FoundationDB.Client.Fdb.<>c.<Start>b__46_0(Object sender, EventArgs args) in /Users/rinat/proj/fdb-layers/dotnet/foundationdb-dotnet-client/FoundationDB.Client/Fdb.cs:line 686

I see two problems here:

  1. Can't use Thread.Abort (MSDN suggests using relying on cancellation tokens)
  2. For some reason FoundationDB native thread (which is asked to stop) doesn't exit by itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    nativeInterop with the native client library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions