ChriD / Raumserver

Raumserver - A HTTP Request Server to control the RF-Multiroom System
32 stars 11 forks source link

HTTP long polling and responsiveness of Raumserver #59

Open Bonilla opened 7 years ago

Bonilla commented 7 years ago

Hello,

I am working on a web interface for Raumserver.

Ever since I have implemented status updates via long polling, Raumserver is no longer behaving as it's supposed to. After several minutes or sometimes hours of long polling (connection timeout set to two minutes), it becomes unresponsive.

When that happens, Raumserver doesn't exactly seem to crash. The process keeps running on the server and it also keeps writing data to the log file. However, it just doesn't respond to http requests any more. After a while (be it minutes or hours), Raumserver becomes responsive again.

I've gone through the log files and couldn't find any hint. My Raumserver is running on a Raumfeld Stereo M (ARMv7 Processor rev 2, v7l). Installed Raumserver is 1.0.2. My apologies if my description lacks precision but the issue seems to be a bit difficult to track down.

Let me know if you want the logs as the they are rather large in file size.

Many thanks for your help,

Bonilla

ChriD commented 7 years ago

I'll try to reproduce this problem. Did you do only the long polling requests or did you make other ones too? (Play / Pause aso..)

Bonilla commented 7 years ago

The client is also sending other requests in parallel such as the ones you mentioned. However, Raumserver also seems to "crash" when the client is in idle mode and does only long-polling.

Is there any place where I can dump the log files "for your eyes only"?

ChriD commented 7 years ago

I'll check this.

Whats' the status of your web-client? I am recreating the raumserver in nodeJs too (much more stable due no threads aso... easy codeing) I think i will create the same requests and i think i will use nearly the same JSON returns as the C++ Version uses (in fact i can do better in nodejs) and if there would be a client i can test the NodeJs server (or even the c++server) it would be great!

Bonilla commented 7 years ago

Check your emails :)

ChriD commented 7 years ago

Ive taken a look into the problem. It seems to bea mutes lock proble. Due the threading and async options i have to lock resourcves when i am accesing them. And in fact there has to be an issue anywhere in the code which i have to locate :-/