Skip to content

Unable to correctly handle file download with multiple deployments #10583

Open
@jamie0725

Description

@jamie0725

Describe the bug

I notice a weird problem while using the download functionality inside gr.File() when I deploy my app in multiple pods.

Consider the following case and two pods:

Image
  • I have a function that processes user requests which generates an Excel file at the end, the process is handled by pod A, so the file is stored locally inside pod A.
  • Now the user wants to click download, but sometimes this download request is handled by pod B. Therefore, the file download request will fail since the file is never generated in pod B.
  • If the user clicks the download button multiple times, he will eventually download the file successfully -- when the download request is handled by pod A.

Although gr.File() can take a URL as input/output, for corporate scenarios, we can't upload the file to somewhere public.

What I can think of in the first place is that, when I finish generating the file, I upload it to a private GCS bucket, and when the user clicks download, I download it from GCS so I can ensure every pod has the file ready.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

Screenshot

No response

Logs

System Info

5.16.0

Severity

Blocking usage of gradio

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcloudIssues that only happen when deploying Gradio on cloud services

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions