Skip to content
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

Incorrect behavior of aio_view::set_msg(&&) #26

Open
nagua opened this issue May 27, 2021 · 2 comments
Open

Incorrect behavior of aio_view::set_msg(&&) #26

nagua opened this issue May 27, 2021 · 2 comments

Comments

@nagua
Copy link

nagua commented May 27, 2021

Hey everyone,

after a talk with gdamore I was informed, that nng only takes ownership of a msg if the
associated send operation was successful. If the operation wasn't successful the message
will no be free'd.

So I think the current move operator implementation in aio_view should be deleted.

I can hopefully do a pull request for that in the coming days.

@nagua
Copy link
Author

nagua commented May 27, 2021

I was made aware that you can recover from that situation with aio_view::release_msg.
Now I'm not so sure anymore, what the right path is.

@EvanBalster
Copy link

It's my thinking that calling release_msg in the completion callback when some error has occurred is a best practice based on how the underlying library works. It's awfully easy to overlook, but on the upside it isn't an error to call release_msg on an AIO that doesn't own a message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants