server: reset counter related to kill-switch on client error#20513
Merged
ggerganov merged 3 commits intoggml-org:masterfrom Mar 13, 2026
Merged
server: reset counter related to kill-switch on client error#20513ggerganov merged 3 commits intoggml-org:masterfrom
ggerganov merged 3 commits intoggml-org:masterfrom
Conversation
This avoids triggering a server kill switch. If the client sends a request that exceeds the configured context size, an appropriate HTTP 400 response is provided and no tokens are generated. However since no tokens are generated, update_slots() increments n_empty_consecutive. If the client sends 3 such messages in a row, the server terminates.
ggerganov
reviewed
Mar 13, 2026
Member
ggerganov
left a comment
There was a problem hiding this comment.
It would be better to move this to launch_slot_with_task() - right before returning true.
Contributor
Author
Done. I was worried that it might interfere with the debugging efforts in #20277 . After looking at that issue closer, if I'm understanding it correctly: the loop occurs within the same task and slot. So resetting the counter won't impact that because the reset occurs before a new task/slot. |
ggerganov
approved these changes
Mar 13, 2026
Ethan-a2
pushed a commit
to Ethan-a2/llama.cpp
that referenced
this pull request
Mar 20, 2026
…g#20513) * server: reset kill-switch on client error This avoids triggering a server kill switch. If the client sends a request that exceeds the configured context size, an appropriate HTTP 400 response is provided and no tokens are generated. However since no tokens are generated, update_slots() increments n_empty_consecutive. If the client sends 3 such messages in a row, the server terminates. * moved counter reset as per recommendation * cont : minor --------- Co-authored-by: Georgi Gerganov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This avoids inadvertently triggering a server kill switch.
If the client sends a request that exceeds the configured context size, an appropriate HTTP 400 response is provided and no tokens are generated.
However since no tokens are generated, update_slots() increments n_empty_consecutive. If the client sends 4 such messages in a row, the server terminates.
This change resets the counter when the client's request exceeds
--ctx-size. While I was looking at this, neighboring code had similar patterns relating to the sameERROR_TYPE_EXCEED_CONTEXT_SIZE, however I'm not familiar with those other conditions.Steps to reproduce issue:
--ctx-size 10