-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequestStatus and action fails don't clean up lock #44
Comments
Are you using Tunneling? I was only partly able to reproduce your issue with Tunneling (works for Routing): I also get the wrong exception (I get a knx.net/src/KNXLib/KnxSenderTunneling.cs Lines 118 to 123 in 6b50cef
The InvalidKnxAddressException is catched here and null is returned which then is tried to be send via udp. I think we can just replace return null; with throw; . Otherwise we'd need to introduce a null check atknx.net/src/KNXLib/KnxSender.cs Line 21 in 6b50cef
|
I am using tunneling |
Would you be able to test if the fix I mentioned in my previous comment works for you? |
I changed the return null to throw in KnxSenderTunneling.CreateRequestStatusDatagram and KnxSenderTunneling.CreateActionDatagram during the finally in KnxLockManager.PerformLockedOperation it does call SendUnlockPauseThread During debugging it froze at the next _sendLock.Wait call, however I believe it is because at that point the connection dropped. |
When requesting the status of an invalid group address, the CreateRequestStatusDatagram(destinationAddress) function call in
KnxSender.cs:RequestStatus(string) will return null.
SendData will be called with null, causing the backend to fail with an exception.
At this point when you caught the exception in the main program the next knx action will be encountering the lock that was previously set, causing the program to hang indefinitely
Test case:
And while we are at it, a nice, public check knx addr function that returns true if the address is valid and false otherwise would be a really nice addition.
The text was updated successfully, but these errors were encountered: