[Homekit] jmdns Concurrent Modification Exception

Hey,
since I got the Homekit binding running really stable for a few days after disabling the meshing on my Unifi APs (thank god…) I am greeted by a new kind of bug. After the OH 3.0 update I get the following exception and I don’t understand what’s causing it:

Jan 25 21:00:28 openHABian karaf[11623]: Exception in thread "SocketListener(openhabian-hostname.local.)" java.util.ConcurrentModificationException
Jan 25 21:00:28 openHABian karaf[11623]:         at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
Jan 25 21:00:28 openHABian karaf[11623]:         at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
Jan 25 21:00:28 openHABian karaf[11623]:         at javax.jmdns.impl.DNSCache.getDNSEntry(DNSCache.java:142)
Jan 25 21:00:28 openHABian karaf[11623]:         at javax.jmdns.impl.JmDNSImpl.handleRecord(JmDNSImpl.java:1362)
Jan 25 21:00:28 openHABian karaf[11623]:         at javax.jmdns.impl.JmDNSImpl.handleResponse(JmDNSImpl.java:1476)
Jan 25 21:00:28 openHABian karaf[11623]:         at javax.jmdns.impl.SocketListener.run(SocketListener.java:77)

This results in the loss of the MDNS entry for Homekit.

I found an issue at the openhab-addons repository on GitHub and one at the JMDNS repository describing the same problem, but no one found a reason for it. I would wish for my OpenHab to log the whole stacktrace. Is this possible?

Also the only change relating to this is the update of JMDNS in OpenHab 3.0, which is the kind of version the issue above has the same issue with. Is this a usage error in the Homekit binding or a bug in the dependency itself? @Kai I found your name in the JMDNS repository, so maybe you have more insight?

1 Like