nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
377 stars 19 forks source link

Not responding if the device is left open for too long #67

Open renkun-ken opened 3 years ago

renkun-ken commented 3 years ago

In VSCode, if the httpgd device is left open for too long, then the webpage will no longer respond to new plots, i.e. it does not update any more. Looks like the background communication is disconnected or lost.

Currently, I don't have a simple and robust way to reproduce it but it almost always happens if a plot is produced (thus the device is open) and the session is left idle for say one day.

nx10 commented 3 years ago

Thanks for the bug report. I think I also experienced something similar a couple days ago after my PC resumed from standby. I will see if I can replicate it that way.

kklot commented 2 years ago

it might be related, when this happened I tried calling hgd_close() and it works again, but only some of the times; more often it just hangs there in the terminal and cannot stop it with ctrl+c. Need to restart R to get it back.

JohannesNE commented 2 years ago

This happens for me every time I run the function brms::pp_check() on a specific model. I do not even have to draw the ggplot returned by the function. I have not been able to reproduce it in a simple (shareable) example. Is there some kind of verbose output I could share to help get to the root of this?

Gavin-Lijy commented 2 years ago

Hi, still not solved. Could you please help us?

nx10 commented 2 years ago

@Gavin-Lijy Thank you for following up, I unfortunately have still not found a way to replicate this. I am quite busy with other projects ATM, but I have been working on and off on a big update to the httpgd internals, which if it does not fix this problem will make it easier to investigate. Still, please share if you can find a way to replicate.

Gavin-Lijy commented 2 years ago

@nx10 Thank you for your warm reply. I have solved it by "dev.off()", then plot again and the device will open and work well(@renkun-ken hope it helps). Thank you for your amazing package man!

rdiaz02 commented 6 months ago

This happens to me very often. But I do not understand @Gavin-Lijy solution: if I do "dev.off" the device is closed. I need to launch a new hgd.