match libpq treatment of null byte in message header #953
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 is a partial fix for #886. Under a load of 128 concurrent queries, I see 90% fewer failed queries with this change.
This changes the behavior of the driver to match that of libpq. Namely, if a message header starts with a null byte, discard the message and continue without signaling an error.
This is only a partial fix. With this, I still see 1% of queries fail. That's better than 10%, but there's still an issue somewhere.
The issue is not due to dropping PgStream or BufStream. That is not occurring. I instrumented a Drop implementation for them and they are not dropped while the failed queries occur.