rstudio / httpuv

HTTP and WebSocket server package for R
Other
229 stars 86 forks source link

Unloading httpuv should stop all servers #226

Open wch opened 5 years ago

wch commented 5 years ago

When the httpuv packages is unloaded, it should stop all running servers, wait a little while for them to stop, and then terminate them if necessary (so that background thread will stop).

This issue shows itself when, on Windows, a server is running, and then in RStudio, you run Install and Restart. RStudio calls .rs.forceUnloadPackage(), which unloads the package in the R process, but the DLL stays loaded because of the running code, and the installation fails because the DLL can't be replaced.