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

tokio: Fix the way of using oneshot::Sender #170

Merged
merged 1 commit into from
Feb 10, 2022

Conversation

vadorovsky
Copy link
Member

According to docs of tokio::sync::oneshot::Sender.send, that method
"attempts to send a value on this channel, returning it back if it could
not be sent."

Err case of send() is just simply returning the sent value back. Quite
confusing, I was expecting some real error there. But well, according to
the example snippet:

https://docs.rs/tokio/1.16.1/tokio/sync/oneshot/struct.Sender.html#examples-1

we are just logging a custom error there.

Signed-off-by: Michal Rostecki mrostecki@opensuse.org

According to docs of tokio::sync::oneshot::Sender.send, that method
"attempts to send a value on this channel, returning it back if it could
not be sent."

Err case of send() is just simply returning the sent value back. Quite
confusing, I was expecting some real error there. But well, according to
the example snippet:

https://docs.rs/tokio/1.16.1/tokio/sync/oneshot/struct.Sender.html#examples-1

we are just logging a custom error there.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
Copy link
Collaborator

@mjura mjura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it is partially fixing #169
error:

mjura@gecko:~/git/lockc> kubectl logs -n lockc lockcd-dn7kf -f
2022-02-09T14:08:17.937616Z ERROR lockcd: could not send eBPF command result although the operation was succeessful command="add_proceess

@vadorovsky vadorovsky merged commit e26285e into lockc-project:main Feb 10, 2022
@vadorovsky vadorovsky deleted the fix-tokio-tx branch February 10, 2022 17:42
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

Successfully merging this pull request may close these issues.

2 participants