Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function never executes when browser window is closed when in queue #8708

Open
1 task done
peeter2 opened this issue Jul 5, 2024 · 2 comments
Open
1 task done

Function never executes when browser window is closed when in queue #8708

peeter2 opened this issue Jul 5, 2024 · 2 comments
Labels
bug Something isn't working pending clarification

Comments

@peeter2
Copy link

peeter2 commented Jul 5, 2024

Describe the bug

Somewhy the function never executes when the user is in queue and closes the browser window before the queue reaches to process his request.
Am I missing something or is this a bug? I need the visitor's request to be in queue even if he closes the browser window. I don't want unlimited concurrency, I need only one concurrent process. The function should eventually start when the queue reaches him (the function will send him an email notification) even if he has closed the browser window long ago.

I could not find any info on this from the documentation.

Thanks.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

Screenshot

No response

Logs

No response

System Info

yes

Severity

I can work around it

@peeter2 peeter2 added the bug Something isn't working label Jul 5, 2024
@abidlabs abidlabs added docs/website Related to documentation or website and removed docs/website Related to documentation or website labels Jul 5, 2024
@abidlabs
Copy link
Member

abidlabs commented Jul 5, 2024

Hi @peeter2 yes this is the intentional behavior. If a user uses your app through the Gradio queue, then they will automatically be removed if they close their browser window. This is to prevent the queue from exploding with very popular apps. What you could do potentially is to set queue=False for your event, in which case Gradio's queue is not used to manage your event, and your event is directly sent to FastAPI's API endpoint. In which case, concurrency is now controlled by FastAPI instead of Gradio. If you want to adjust the number of FastAPI threads, you can set the max_threads argument in launch()

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
@abidlabs abidlabs reopened this Jul 5, 2024
@abidlabs
Copy link
Member

abidlabs commented Jul 5, 2024

Let me know if this workaround works for you @peeter2^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending clarification
Projects
None yet
Development

No branches or pull requests

2 participants