Open vlaggeor opened 2 months ago
A proposed fix is in https://github.com/lldpd/lldpd/pull/676
I face the same issue now. Since the lldpctl_watch
function is read()
-blocked it must somehow be unblocked. I don't see how this is achieved by #676.
I guess whether to unblock implicitly when closing the connection or to add a corresponding public function is just a design flavor. In any case this must be triggered by a separate thread.
@vincentbernat Any ideas how to unblock the read()
-blocked thread? Perhaps by a sequence similar to:
read
unblock with EINTR
.read
again check for a valid state and return if it was invalidated.I think the connection should just be closed. A signal is not pretty and subject to some race condition (if the thread unblock before processing the signal for example).
Writing a simple application that has
will lead to a hung.
This is because because
lldpctl_watch
remains in awhile
loop onwatch_triggered
that will be called only. when change is received and notification is called incheck_for_notification