cuteant / SpanNetty

Port of Netty(v4.1.51.Final) for .NET
MIT License
301 stars 47 forks source link

UnobservedTaskException in finalizer thread #35

Closed kvpt closed 3 years ago

kvpt commented 3 years ago

Hi,

I try to migrate my code from DotNetty to SpanNetty. The code compile without change but now errors that was not present with DotNetty are present in the logs.

The exception message is the following

No operations are allowed on void promise

This is very easy to replicate with very basic setup like the echo example.

First add the following line in the main method

TaskScheduler.UnobservedTaskException += (sender, eventArgs) => Debugger.Break();

Then

The exception is triggered in echo server

This not seem to cause the pipeline to halt, the messages continue to be processed but an exception like this in the finalizer thread make me think there may be a resource leak somewhere. Morevover I don't have this exception with DotNetty.

I can trigger the same exception with any configuration that I have tested, with an empty pipeline, using libuv or not, on windows or on linux nothing seems to mater.

Thanks.

cuteant commented 3 years ago

I will test this program, please wait a few days......