Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature Request: Task Cancellation on Client Disconnection #6421

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

Closed
4 tasks done
redlion0929 opened this issue Apr 1, 2024 · 5 comments
Closed
4 tasks done

Feature Request: Task Cancellation on Client Disconnection #6421

redlion0929 opened this issue Apr 1, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed server/webui

Comments

@redlion0929
Copy link
Contributor

redlion0929 commented Apr 1, 2024

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new bug or useful enhancement to share.

Feature Description

In the current embedding server setup, if a client sends a request and then cancels it, tasks that are already queued continue processing without detecting the cancellation. This can lead to inefficiencies and potential server overload.

[Test Case]
During an actual load test, I canceled a request, but the queued requests prior to the cancellation were processed to completion, causing subsequent requests to be delayed.

[After Modification]
During a load test, when a request is cancelled, task processing should be terminated. If a new request is sent immediately afterward, it should be processed without delay.

Motivation

If a client makes a massive number of requests and then disconnects, the server could become paralyzed. I would like to remove tasks from the queue if the associated request is terminated.

Possible Implementation

I don't have experience with configuring servers in C++, so it's difficult for me to suggest implementation details. If you have an idea as to how it can be implemented, please write a detailed description. Feel free to give links to external sources or share visuals that might be helpful to understand the details better.

@redlion0929 redlion0929 added the enhancement New feature or request label Apr 1, 2024
@phymbert phymbert added help wanted Extra attention is needed good first issue Good for newcomers server/webui labels Apr 1, 2024
@phymbert
Copy link
Collaborator

phymbert commented Apr 1, 2024

A test scenario should be included with the changes

@rahsuri
Copy link

rahsuri commented Apr 1, 2024

Hello, I am currently in college and in a Software Engineering class where one of our assignments requires us to contribute to an open source project, specifically in the form of a bug fix or feature request. If possible, would I be able to be assigned this task? I have lots of experience with C++ so this feature request is in my scope of ability.

@phymbert
Copy link
Collaborator

phymbert commented Apr 1, 2024

Cool, ping here if you have question. Please try to open the PR when all checks pass on your fork. Good luck!

@rahsuri
Copy link

rahsuri commented Apr 1, 2024

Cool thank you!

@ngxson
Copy link
Collaborator

ngxson commented May 16, 2025

should already been resolved in #11285

@ngxson ngxson closed this as completed May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed server/webui
Projects
None yet
Development

No branches or pull requests

4 participants