Issues with shiny::downloadHandler in Kubernetes pods using HPAs

Have a question for shiny developers with kubernetes experience.

Has anyone experienced intermittent timeouts / errors downloading files from shiny using shiny::downloadHandler when a set of pods are provisioned via a horizontal pod autoscaler (HPA)?

My experience / observations are as follows:

  1. User goes to app, downloads file successfully
  2. HPA provisions a couple more pods of the shiny app due to resource usage
  3. Another user goes to apps (around same time of HPA scale up), downloads file unsuccessfully
  4. Same user refreshes the page, downloads file successfully

If I turn off the HPA and set the number of pods to something static, this issue never happens. Does anyone have any ideas?

From the logs, I see that my load balancer occasionally shows a 404 on download handlers: [10/Oct/2023:12:59:16 +0000] GET /session/3c6a68f303fa7a5644f8b4494d0d5dbd/down...

So wondering if there is something weird with the session ID when it comes to HPAs?

Think I figured it out: Session ID/token exposed with downloadHandler · Issue #3748 · rstudio/shiny · GitHub

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.