openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[knx2] reading values does not work any more #5916

Closed Alex5719 closed 5 years ago

Alex5719 commented 5 years ago

Hello,

I am running a snapshot build of OpenHAB 2.5 with the knx2 binding accessing two different KNX IP Interfaces in TUNNEL mode. Therefor I have configured two separate KNX Bridges in my things file. My Configuration was running well till build 1607. The later builds showed the strange behaviour that KNX read requests did not work randomly on one or the other bridge.

I first thought the strange behaviour is due to the running refactorings but I now installed the new milestone 2 build of OH 2.5 and I still get the described strange behaviour.

I get the following exception in my log (2.5 Milestone 2 Build):

2019-08-11 16:25:26.600 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: java.lang.NullPointerException: null at org.openhab.binding.knx.internal.client.AbstractKNXClient.readNextQueuedDatapoint(AbstractKNXClient.java:283) ~[?:?] at org.openhab.binding.knx.internal.client.AbstractKNXClient.lambda$1(AbstractKNXClient.java:199) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51 1) ~[?:?] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[?: ?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. access$301(ScheduledThreadPoolExecutor.java:180) ~[?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask. run(ScheduledThreadPoolExecutor.java:294) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor. java:1149) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor .java:624) [?:?] at java.lang.Thread.run(Thread.java:748) [?:?]

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for Bugs)

1. 2.

Context

Your Environment

nanosonde commented 5 years ago

I am also experiencing the same issue here with the same error messages in openhab.log. I am also using KNX in tunnel mode with a certified KNX Gateway from MDT. In 2.5.0 M1 this was running flawlessly.

Seems to be related to these changes: https://github.com/openhab/openhab2-addons/pull/5695/

Alex5719 commented 5 years ago

I am also using MDT devices.

nanosonde commented 5 years ago

There used to be the following NULL check before it was removed here.

However, from [here](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/LinkedBlockingQueue.html#poll()) I can see that poll() returns NULL if the queue is empty. So the check should still be there in this case.

kaikreuzer commented 5 years ago

@J-N-K as you worked on https://github.com/openhab/openhab2-addons/pull/5695, which was the only change: Can you reproduce this issue and would have an idea how to fix it?

J-N-K commented 5 years ago

My fault. Will provide a fix ASAP.

Alex5719 commented 5 years ago

I have installed snapshot build 2.5.0~S1663-1 and can confirm that the bug is fixed.

Thank you for your great work on openHAB.