FHEM Forum

FHEM => Frontends => FHEMWEB => Thema gestartet von: Nestor am 25 Februar 2019, 11:56:40

Titel: Plotfork only forks when plotEmbed is 1
Beitrag von: Nestor am 25 Februar 2019, 11:56:40
When plotfork=1 and plotEmbed=0 (default) the if condition seems to be skipped here:
https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/01_FHEMWEB.pm#L540

When plotEmbed=1 the if condition is executed and fhem forks correctly.
Also in nginx access log:
"GET /fhem/SVG_showLog?dev=SVG_EnO_05115995&logdev=FileLog_EnO_05115995&gplotfile=SVG_EnO_05115995&logfile=CURRENT&pos= HTTP/1.1"

This GET request is missing when plotEmbed=0
Is this expected behaviour? It does not seem to be documented.
Titel: Antw:Plotfork only forks when plotEmbed is 1
Beitrag von: rudolfkoenig am 25 Februar 2019, 20:55:13
The mentioned line is irrelevant for plotEmbed=0 (which means, "do not use the <embed> Tag, return the whole document in one piece").
The relevant code in this case starts at line 1981.

Be aware, that this parameter combination ist buggy, if the rendering of the whole page takess "too long", as in such a case the browser requests the page again, which causes havoc. It is on my list of todos to rewrite this code, by requesting the data via JS, which again, would make the lines starting at 1981 superfluous.
Titel: Antw:Plotfork only forks when plotEmbed is 1
Beitrag von: Nestor am 26 Februar 2019, 09:59:45
Rendering yearly SVG plots was freezing Fhem main process > 1 second, so that was the reason I tried setting plotfork=1 and noticed that this didn't fork until setting plotEmbed=1. This should maybe be mentioned in the docs, but I understand this feature is deprecated?

With plotfork=0 and plotEmbed=0, the SVG plots should be rendering non-blocking as you mentioned here:
https://forum.fhem.de/index.php/topic,82351.msg818789.html#msg818789
https://svn.fhem.de/trac/browser/trunk/fhem/FHEM/01_FHEMWEB.pm#L1981
But this still freezes Fhem main thread when displaying yearly SVG plots, so setting plotfork & plotEmbed=1 cleared the freezes in my case.
Titel: Antw:Plotfork only forks when plotEmbed is 1
Beitrag von: rudolfkoenig am 26 Februar 2019, 10:10:55
Zitatnoticed that this didn't fork until setting plotEmbed=1.
This shouldnt be the case (I tested it a lot), but the logged messages are completely different for plotEmbed=0 (default).

ZitatBut this still freezes Fhem main thread when displaying yearly SVG plots, so setting plotfork & plotEmbed=1 cleared the freezes in my case.
Can you please attach an "attr global verbose 5" log of the freeze?