Skip to content

Cancelling a python client job won't stop the job from running on the server #8188

Closed
@freddyaboulton

Description

Describe the bug

If you cancel a job with the client, it will keep running on the remote server.

I think the reason is that cancel will only tell the thread that's pulling results off the queue that it should stop. It won't stop the thread that's connecting to the server.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Run the cancel_events demo (increase the sleep to 1 second so that you have time to cancel)

from gradio_client import Client
client = Client("http://127.0.0.1:7860")
job = client.submit(7, api_name="/fake_diffusion")
job.cancel()

You will see that the server keeps printing output in the console

Screenshot

cancel_python

Logs

No response

System Info

main

Severity

Blocking usage of gradio

Metadata

Labels

bugSomething isn't workinggradio_clientRelated to the one of the gradio client libraries

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions