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

netlink: Issue #60, fix onewire not present, and hanging when it is. #61

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

gsexton
Copy link
Contributor

@gsexton gsexton commented Sep 20, 2024

Fixes Issue #60, periph-cmd/onewire-list not working because the netlink package wasn't initialized.

There is a problem with loading netlink when the onewire bus drivers aren't loaded. If you run an executable with the netlink package loaded, and the onewire driver isn't loaded, the application hangs indefinitely. This was causing pipeline failures. It appears that netlink.Init() is sending a request on the netlink interface for onewire masters, but nothing is responding so it hangs.

My initial thought to resolve the hang was to put a network timeout on the request for onewire bus master. However, I think the approach of looking at the /sys/bus pseudo-filesystem is cleaner.

I'll follow up this PR with one to periph-cmd to do small fixes to onewire-list and add and ds18b20 program.

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 26.8%. Comparing base (b69b28c) to head (e05a20a).

Files with missing lines Patch % Lines
netlink/netlink_other.go 0.0% 2 Missing ⚠️
netlink/netlink_linux.go 80.0% 1 Missing ⚠️
netlink/onewire.go 66.7% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main     #61     +/-   ##
=======================================
+ Coverage   26.7%   26.8%   +0.1%     
=======================================
  Files         92      92             
  Lines      11538   11548     +10     
=======================================
+ Hits        3081    3097     +16     
+ Misses      8322    8316      -6     
  Partials     135     135             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

netlink/netlink_linux.go Show resolved Hide resolved
@maruel maruel merged commit 7540d26 into periph:main Sep 23, 2024
8 checks passed
@maruel
Copy link
Member

maruel commented Sep 23, 2024

Thanks again!

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

Successfully merging this pull request may close these issues.

3 participants