-
Notifications
You must be signed in to change notification settings - Fork 89
fix: Do not transfer ownership of chunk buffer (issue #917) #942
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
fix: Do not transfer ownership of chunk buffer (issue #917) #942
Conversation
|
thanks again @MiloszKrajewski! looks good. just need commit gpg signing. you might have to force push after (since all commits need to be signed),which is fine. |
a910427 to
f982658
Compare
f982658 to
de25ce5
Compare
Phew, it took me a while. Apparently when your signature uses CRLF git tells you that signature file does not exist. Another deep debugging ;-) |
|
Any way to get this released even as 🙏 |
of course, we should have a new release sometime today 🤞 |
mtmk
left a comment
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.
LGTM thanks @MiloszKrajewski great fix also a better design
|
@MiloszKrajewski your fix is just released in https://github.com/nats-io/nats.net/releases/tag/v2.6.8 thank you 👍 |
* don't transfer ownership (nats-io#942) * (from preview) Fix Object Store and JetStream publish retry logic (nats-io#937) * (from preview) Don't suppress SystemExceptions in NatsSubBase.ReceiveAsync (nats-io#938)
ObjectStore.PutAsync was transferring ownership of memory buffer.
Memory buffer was returned to the pool on serialization. Everything was going smooth until performance degradation. In such case retries were needed using same memory buffer which was already returned to the pool so it might have contain some other data.
This PR keeps ownership for the whole upload process and does not transfer it down to serializer.
You could argue that
using var memoryOwnermay be moved insidewhileloop, but it will just increase pool churn. There are no otherawaits after publishing so this buffer would return to pool for only few CPU cycles.