-
Notifications
You must be signed in to change notification settings - Fork 141
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
Bugfix: Correct minimum required bounds for serializing cstring and cstringUtf8 #538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with the Builder
internals at this stage, but I think this fix is in line with the bufferFull
haddocks and the other uses of bufferFull
in this repo.
It would be great to get confirmation that this fixes yesodweb/wai#894 though.
Makes sense to me. @basvandijk any chance you can give this patch a spin please? |
This fixes aristanetworks#19 by downgrading the compiler to 8.10 (I still don't think 9.0 should be used in production). bytestring < 0.11.4 (which as of today has not been released to https://hackage.haskell.org/package/bytestring), is broken, as per haskell/bytestring#538. This in turn shows up in yesodweb/wai#894, and ultimately causes aristanetworks#19.
Any chance we get a release out with this bug fix? |
* Update changelog for v0.11.4.0 Co-authored-by: Matthew Craven <[email protected]> * Organize changelog entries for 0.11.4.0 * Re-phrase changelog entry for #538 Co-authored-by: Matthew Craven <[email protected]>
* Update changelog for v0.11.4.0 Co-authored-by: Matthew Craven <[email protected]> * Organize changelog entries for 0.11.4.0 * Re-phrase changelog entry for #538 Co-authored-by: Matthew Craven <[email protected]> (cherry picked from commit 0602eab)
I think this was an oversight in 155bf8a
The bufferFull signal takes the minimum number of required space to make progress. Instead, the defaultChunkSize was used. I can't prove it yet but I have a hunch this is causing yesodweb/wai#894. It looks like defaultChunkSize is 32k. A Warp buffer is something around 16k thus it will always hit the bufferFull signal when writing a cstring/cstringUtf8 requiring a bigger buffer which then makes Warp error out.
Pinging @bgamari as he is the author of the aforementioned patch and @basvandijk, maybe you can try out this fix and see whether it's fixing your issue?