ADLINK-IST / opensplice

This is the Vortex OpenSplice Community Edition source repository. For our commercial offering see
https://www.adlinktech.com/en/vortex-opensplice-data-distribution-service
Apache License 2.0
259 stars 155 forks source link

Detected invalid handle #91

Closed MikaelBertze closed 5 years ago

MikaelBertze commented 5 years ago

When I use OpenSplice 6.9.181018OSS, I get huge error log file. I use the C# API with a onDataAvailable call-back. From the release notes I find that this should have been fixed in version 6.7.2.

Example

Context     : FooDataWriter.WriteDispose
Date        : 2019-05-04T18:11:01+0200
Node        : hostname
Process     : Simulator.exe <52464>
Thread      : 44020
Internals   : FooDataWriter.cs/0/6.9.181018OSS/4cfd22d9/4cfd22d9/0
----------------------------------------------------------------------------------------
Report      : Detected invalid handle
Internals   : OSPL-Core/v_handle.c/338/2/1556986261.529886500
----------------------------------------------------------------------------------------
Report      : The Handle Server ran out of handle space
Internals   : kernel::v_handle::v_handleServerRegister/v_handle.c/301/778/1556986261.529915900

Platform: Win10 Release: PXXX-VortexOpenSplice-6.9.190403OSS-HDE-x86_64.win-vs2017-installer.zip

Relese notes 6.7.2 Report ID: OSPL-9823

C# API reports "Detected invalid handle" in error log during onDataAvailable callback. When the C# API performs an onDataAvailable callback on a DataReaderListener, it also logs a message in the error log that states that an invalid handle was detected. The error reported is harmless and totally irrelevant, and your application will continue to function properly. Solution: An onDataAvailable callback will no longer cause this error to show up in the log.

hansvanthag commented 5 years ago

I've just checked with the bundled (C#) listener example and I don't get any errorlog .. Do you get a similar log when running that same example ?

hansvanthag commented 5 years ago

Another observation: 'your' error above smells like you're creating huge amounts of instances (without unregistering) which at some point would cause your write to fail .. could that be the case (also as I can't relate the above error to call-backs) ?

MikaelBertze commented 5 years ago

My code is runing without errors for some time. The error_log seems to be filled up after the code been running for a while...

I noticed that compared to the example code I've been using the WriteDispose method on the dataWriter insted of the Write method. Could that be causing the error messages? Even though the error logs have been filled with 50Gb of messages, I have not noticed any issues in my application.

hansvanthag commented 5 years ago

As stated, I see no evidence that the error is related to call-backs .. and your statement that your code is running OK for a while somehow again points to my question about how many instances (key-values) you are creating whilst running .. if you keep on generating new instances (key-values) without unregistering (which isn't the same as disposing as dispose is about lifecycle-awareness, not about resource-cleanup) you will eventually run out or resources i.e. get errors ..

MikaelBertze commented 5 years ago

Ok. This appears to be a misunderstanding on my side regarding the message keys. Going through my test code I notice that I do create a new key for every message that is published. Assuming this is the cause and will close the issue. Thanks for the help.