zeromq / netmq

A 100% native C# implementation of ZeroMQ for .NET
Other
2.97k stars 744 forks source link

Pr/check destination null #1093

Open tmatthey opened 6 months ago

tmatthey commented 6 months ago

Remove Debug.Assert(ok);, just return value of m_commandPipe.TryRead. I'm not certain if caller of Mailbox.TryRead may check if command.Destination to be not zero when processing the command, i.e., reading a command with CommandType.Done sent by ZObject.SendDone(), which has no destination.

tmatthey commented 6 months ago

Is there a any chance that any can review and merge my PR? And is there a plan to release a new patch version including this PR? For now we running our application with a debug version including the changes of this PR and we have not seen any exceptions so far. Thanks in advance.

drewnoakes commented 6 months ago

I'm interested to know why you had to defend against a null command in those places.

Also bumping xUnit has created some new warnings. Could you fix those up please, so we have a clean build? Thanks.

tmatthey commented 6 months ago

@drewnoakes, you are right, it was not where I got the actual exception. I fixed all the warnings and put all the task awaiting into a separate class and resolves all your findings.

Process terminated. Assertion failed.
   at NetMQ.Core.Mailbox.TryRecv(Int32 timeout, Command& command)
   at NetMQ.Core.SocketBase.ProcessCommands(Int32 timeout, Boolean throttle, CancellationToken cancellationToken)
   at NetMQ.Core.SocketBase.GetSocketOptionX(ZmqSocketOption option)
   at NetMQ.NetMQSocket.GetSocketOptionX[T](ZmqSocketOption option)
   at NetMQ.NetMQSocket.get_HasIn()
tmatthey commented 6 months ago

@drewnoakes did got any chance to take a look? With the last revert it is just removal of assert and oppgrade of System.ServiceModel.Primitives 4.10.3. Is there any chance to get en new patch release includeing this PR? Thanks in advance.

tmatthey commented 5 months ago

Any chance any could have a look again at this PR? I totally aware that this is an open-source on benevolent base, but I would really appreciate a new patch version.

tmatthey commented 5 months ago

I did a reset and force push to regroup the my changes and make hopefully clear: one for the trey-catch, one for grade of NuGet of the lib code, and one for upgrading NuGet's and fixing unit tests.

follesoe commented 3 months ago

Thanks for your efforts on this @tmatthey - I am making a local NetMq build based on your branch while waiting for this to get reviewed.

tmatthey commented 3 months ago

@follesoe Would be great if you could test too. I'm currently testing this branch in our environment with a local debug build, just to pickup any further asserts.

tmatthey commented 3 months ago

I haven't seen any exceptions with a local debug build since my last commit 3 weeks ago.

follesoe commented 3 months ago

Me neither