Hiya,
we're using RStudio Connect in our company (migrated from Shiny Server Pro) and we're running into some issues with package management (e.g. updates) - FYI, the packages are being loaded in global.R (outside server function).
Our workflow looks like this:
- develop code
- write manifest.json (rsconnect::writeManifest())
- deploy to RStudio Connect (use manifest.json to install packages and place bundle onto the server)
What we're currently observing is that processes which had started prior to the deployment (package updates) are using the original package versions (presuming they're loaded in memory) - this is expected.
The issue arises when user tries to access the app after we've updated he packages (e.g. by navigating to it or refreshing browser window) and instead of starting-up a completely new process, the server seems to recycle one of the existing processes (potentially one that started before package have been updated), which results in user seeing the "old version" of the app.
What we'd like to achieve here is basically an app restart that would guarantee the server will force-start new processes after deployment (package updates) or otherwise reload updated packages. This should preferrably be available in a programmatic fashion (e.g. API) so it can be part of the deployment process itself. Also, it would be great (but not essential) if we won't need to kill all existing processes to achieve this.
We're bringing this up, because we're using similar functionality in Shiny Server Pro: https://docs.rstudio.com/shiny-server/#restarting-an-application - where the deployment job makes sure to update the "restart.txt" file, forcing the app to start a new process upon a new connection.
Any help would be much appreciated.
Stefan