OWSD stops servicing websockets under heavy UBus load...UBus timer stops firing
Hello,
We are using OWSD in our OpenWRT 17 based project. We have discovered that the UBus timer utilized to service websockets in OWSD main.c stops firing under heavy UBus traffic load. Also, when it does stop firing and websockets are not serviced, it appears that the UBus traffic is placed in an unbounded queue which, without websockets being serviced from the UBus timer callback, builds up until memory in the system is exhausted and the OOM kills OWSD. I have attached a modified main.c below which uses some code I borrowed from dnsmaq source that polls the UBus file descriptor. I also decreased the timeout from 1 second to 10 milliseconds, upgraded to libwebsockets 3.2.3 and use the libwebsockets API call appropriate for libwebsockets 3.2.3 in order to service websockets. I did not attempt to address the unbounded queue issue.