openanalytics / shinyproxy

ShinyProxy - Open Source Enterprise Deployment for Shiny and data science apps
https://www.shinyproxy.io
Apache License 2.0
525 stars 151 forks source link

Release Proxy after clicking the home page button #458

Open lfagliano opened 1 year ago

lfagliano commented 1 year ago

Hello!

Thank you for your repo and documentation, it has been very useful on deploying my apps.

However, I am having a problem right now, where an app, which utilizes a SQL connection, has some weird interactions when clicking the home button on the top bar.

What is happening:

  1. A user logs into the server
  2. They go the app
  3. The app loads
  4. They utilize the app.
  5. They disconnect of the app (but not of the shinyproxy server)
  6. They click the home page

IF they click back on the app before 60 seconds:

  1. The app loads very fast
  2. The app looks like a "catcher" version of the first time they loaded the app
  3. The app is unable to connect to SQL, and crashes.

IF they wait for more than 60 seconds:

  1. The app launches again (loading the container)
  2. Everything looks like it is supposed to be and works normally.

Behind the scenes I have noticed some things:

What I tried:

  1. I tried adding a force reconnection within my app to the SQL table, but it just doesn't work when in shinyproxy.
  2. I tried adding the heartbeat-timeout option to the app, this manages to terminate the container - BUT when they launch the app again, it is a blank white screen, and a container is not created.
  3. The app works when the proxy is activated and released.

Hence the question, is there anyway of releasing the proxy after the user clicks the home page button?

LEDfan commented 10 months ago

Hi, there is currently not such an option. I think the best solution would be to try to fix the issue when users re-open the app. You could try running the app as a standalone docker app, open the app in your browser and try to refresh the page in order to see whether you can reproduce the issue and fix it hopefully.