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

Add queue cancellation on request cancellation #19

Merged
merged 1 commit into from
Nov 11, 2023

Conversation

nstogner
Copy link
Contributor

Fixes #18

Also started refactoring the main package into sub-pkgs.

@nstogner
Copy link
Contributor Author

Waiting for dockerhub to come back up...

Screenshot 2023-11-11 at 11 33 52 AM

@nstogner
Copy link
Contributor Author

Appears to fix the original issue, cancelled requests appear to be removed from the queue immediately after cancellation:

2023/11/11 22:52:23 Average for deployment: stapi-minilm-l6-v2: 573 (ceil: 6), current wait count: 754
2023/11/11 22:52:23 Average for deployment: kubernetes: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:23 Average for deployment: lingo: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:26 Average for deployment: stapi-minilm-l6-v2: 525.5 (ceil: 6), current wait count: 0
2023/11/11 22:52:26 Average for deployment: kubernetes: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:26 Average for deployment: lingo: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:29 Average for deployment: kubernetes: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:29 Average for deployment: lingo: 0 (ceil: 0), current wait count: 0
2023/11/11 22:52:29 Average for deployment: stapi-minilm-l6-v2: 480 (ceil: 5), current wait count: 0

@nstogner nstogner merged commit 3f78556 into main Nov 11, 2023
3 checks passed
@nstogner nstogner deleted the fix-queue-cancellation branch November 11, 2023 23:03
c := make(chan struct{})
q.queued <- c
<-c
return func() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nstogner before the dequeue happened in the returned func, but in the new code in this PR, the dequeue happens right away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queue placement is not cancelled on request cancellation
2 participants