kerryjiang / SuperSocket

SuperSocket is a light weight, cross platform and extensible socket server application framework.
Apache License 2.0
3.95k stars 1.15k forks source link

Channel is closed now, send is not allowed. #516

Open ozgun77 opened 3 years ago

ozgun77 commented 3 years ago

Before sending message even though we check session state and channel is closed we get a lot of these errors: "Channel is closed now, send is not allowed."

We can't find what causing this situation and this error is increasing our error logs, sometimes trigger alarms. It's a handled exception in PipeChannel. Any chance you can remove throwing this exception or add it as a ignorable exception or can you tell me what can cause this error if you have any idea?

Thank you.

kerryjiang commented 3 years ago

Did the problem happen to one session repeat?

OrhanBabayigit commented 3 years ago

We have the same error "System.Exception: Channel is closed now, send is not allowed.". It happens in bursts occasionally

Stacktrace:

SuperSocket.PackageHandlingException1[SuperSocket.ProtoBase.StringPackageInfo]: Session e28f3a6a-2a1f-4b66-aa09-166720d0edb9 got an error when handle a package. ---> System.Exception: Channel is closed now, send is not allowed. at SuperSocket.Channel.PipeChannel1.CheckChannelOpen() at SuperSocket.Channel.PipeChannel1.SendAsync(ReadOnlyMemory1 buffer) ourCode.ExecuteAsync(IAppSession session, StringPackageInfo package) at SuperSocket.Command.AsyncCommandWrap4.ExecuteAsync(TAppSession session, TPackageInfo package) at SuperSocket.Command.CommandMiddleware3.CommandSet1.ExecuteAsync(IAppSession session, TPackageInfo package) at SuperSocket.Command.CommandMiddleware3.HandlePackage(IAppSession session, TPackageInfo package) at SuperSocket.Server.PackageHandlingSchedulerBase`1.HandlePackageInternal(IAppSession session, TPackageInfo package) --- End of inner exception stack trace ---

Logs: grafik

We don't know why this happens, can you take a look?