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

agent: Fix possible crash when modifying Configuration #602

Merged
merged 2 commits into from
May 30, 2023

Conversation

diconico07
Copy link
Contributor

What this PR does / why we need it:
When modifying a Configuration that made the discovery handler drop the connection (e.g an invalid udev rule for udev handler), the finished_discovery_receiver gets None as the connection was dropped by the other end.
This lead to a crash of the agent as the Option was unwrapped here.

Now ignoring the None case to avoid crash.

Special notes for your reviewer:

If applicable:

  • this PR has an associated PR with documentation in akri-docs
  • this PR contains unit tests
  • added code adheres to standard Rust formatting (cargo fmt)
  • code builds properly (cargo build)
  • code is free of common mistakes (cargo clippy)
  • all Akri tests succeed (cargo test)
  • inline documentation builds (cargo doc)
  • all commits pass the DCO bot check by being signed off -- see the failing DCO check for instructions on how to retroactively sign commits

Copy link
Contributor

@kate-goldenring kate-goldenring left a comment

Choose a reason for hiding this comment

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

Thanks @diconico07!

When modifying a Configuration that made the discovery handler drop the
connection (e.g an invalid udev rule for udev handler), the
finished_discovery_receiver gets None as the connection was dropped by
the other end.
This lead to a crash of the agent as the Option was unwrapped here.

Now ignoring the None case to avoid crash.

Signed-off-by: Nicolas Belouin <[email protected]>
Signed-off-by: Nicolas Belouin <[email protected]>
@diconico07 diconico07 requested a review from johnsonshih as a code owner May 26, 2023 11:55
@diconico07 diconico07 merged commit 33c85fc into project-akri:main May 30, 2023
@diconico07 diconico07 deleted the fix-agent-crash branch May 30, 2023 12:16
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