Conversation
terrelln
approved these changes
Jan 25, 2023
Merged
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.
In a busy-loop scenario, the user process calls a
libzstdstreaming function in a loop,but no work gets ever done, due to some external condition.
For example there is no input to process,
or the output buffer is already full and cannot accept another byte.
These scenarios are considered programming errors. When there is no forward progress, the program can continuously call
libzstdin a (potentially infinite) busy loop, cramming away cpu resources and power supply. The caller should not continuously present an empty input (it should wait for some bytes to process), nor an already full destination buffer (it should be flushed first).To avoid this outcome,
libzstdreturns an error code after too many function calls with no forward progress happened.#3454 notes that the corresponding error codes can be difficult to interpret, because they are not specific enough.
This PR adds 2 new error codes, employed specifically for these
noForwardProgressscenarios, so that the root cause of the error can be more easily identified.fixes #3454