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

fix(system_monitor): change communication to unix domain socket #2608

Closed
wants to merge 23 commits into from

Conversation

ito-san
Copy link
Contributor

@ito-san ito-san commented Jan 4, 2023

Signed-off-by: ito-san [email protected]

Description

There is a bug that the ROS node hdd_monitor communicates with the daemon process hdd_reader running on another ECU instead of that running on local computer when system_monitor runs on multiple ECUs at the same time.
The hdd_monitor and hdd_reader uses INADDR_ANY for socket programming, and the socket was bound to all network interfaces instead of localhost only.
image

The ROS node and daemon process is designed to communicate within localhost only, so I made a change to use an UNIX domain socket for local socket communication.
image

Changes

  1. Use an UNIX domain socket(/tmp/hdd_reader) instead of INADDR_ANY.
  2. Code refactoring to clean up complex codes.

Related links

TIER IV INTERNAL LINK TO SLACK

Tests performed

Verify all diagnostic topics regarding hdd_monitor are reported correctly.

  1. Run Autoware.

  2. Run rqt_runtime_monitor.

    ros2 run rqt_runtime_monitor rqt_runtime_monitor
    1. HDD Connection
      image

    2. HDD Usage
      image

    3. HDD Temperature
      image

    4. HDD PowerOnHours
      image

    5. HDD TotalDataWritten
      image

    6. HDD Recovered Error
      image

    7. HDD ReadDataRate
      image

    8. HDD ReadIOPS
      image

    9. HDD WriteDataRate
      image

    10. HDD WriteIOPS
      image

Verify no warning and error messages in a normal run.

image

Notes for reviewers

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

@ito-san ito-san self-assigned this Jan 4, 2023
@github-actions github-actions bot added the component:system System design and integration. (auto-assigned) label Jan 4, 2023
@ito-san ito-san added type:bug Software flaws or errors. type:new-feature New functionalities or additions, feature requests. labels Jan 4, 2023
@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Attention: Patch coverage is 0% with 780 lines in your changes missing coverage. Please review.

Project coverage is 11.38%. Comparing base (071668b) to head (d547315).
Report is 5538 commits behind head on main.

Files with missing lines Patch % Lines
...tem/system_monitor/src/hdd_monitor/hdd_monitor.cpp 0.00% 526 Missing ⚠️
...m_monitor/reader/hdd_reader/hdd_reader_service.cpp 0.00% 85 Missing ⚠️
system/system_monitor/include/hdd_reader/ata.hpp 0.00% 75 Missing ⚠️
system/system_monitor/include/hdd_reader/nvme.hpp 0.00% 44 Missing ⚠️
...stem_monitor/reader/hdd_reader/hdd_reader_main.cpp 0.00% 22 Missing ⚠️
...m_monitor/include/hdd_reader/hdd_reader_common.hpp 0.00% 19 Missing ⚠️
...include/system_monitor/hdd_monitor/hdd_monitor.hpp 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2608      +/-   ##
==========================================
- Coverage   11.94%   11.38%   -0.57%     
==========================================
  Files        1321     1276      -45     
  Lines       91859    88286    -3573     
  Branches    24467    23077    -1390     
==========================================
- Hits        10975    10053     -922     
+ Misses      69528    67570    -1958     
+ Partials    11356    10663     -693     
Flag Coverage Δ *Carryforward flag
differential 0.00% <0.00%> (?)
total 11.44% <0.00%> (-0.50%) ⬇️ Carriedforward from 45d203e

*This pull request uses carry forward flags. Click here to find out more.

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

ito-san and others added 19 commits January 4, 2023 18:16
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
Signed-off-by: ito-san <[email protected]>
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Jan 10, 2023
@ito-san ito-san marked this pull request as ready for review January 10, 2023 04:03
@ito-san ito-san requested a review from asana17 as a code owner January 10, 2023 04:03
@ito-san ito-san requested a review from a team as a code owner January 10, 2023 04:03
@ito-san
Copy link
Contributor Author

ito-san commented Jan 10, 2023

@asana17 Sorry but many changes were made. Verified hdd_monitor works correctly.

@ito-san ito-san enabled auto-merge (squash) January 10, 2023 04:04
Copy link
Contributor

@asana17 asana17 left a comment

Choose a reason for hiding this comment

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

The hdd_monitor functions are LGTM.
From the parameter file hdd_monitor.param.yaml, can't multiple local HDDs or disks other than "disk0" currently be monitored?

@asana17
Copy link
Contributor

asana17 commented Mar 7, 2023

The hdd_monitor functions are LGTM. From the parameter file hdd_monitor.param.yaml, can't multiple local HDDs or disks other than "disk0" currently be monitored?

This can be solved in future PR. so I remain it.

@stale
Copy link

stale bot commented May 6, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label May 6, 2023
@ito-san ito-san removed the status:stale Inactive or outdated issues. (auto-assigned) label May 6, 2023
@stale
Copy link

stale bot commented Jul 9, 2023

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Jul 9, 2023
@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Nov 2, 2023
Copy link

stale bot commented Jan 1, 2024

This pull request has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the status:stale Inactive or outdated issues. (auto-assigned) label Jan 1, 2024
@xmfcx
Copy link
Contributor

xmfcx commented Dec 10, 2024

@ito-san is this PR still relevant? Could you rebase this if it's necessary?
If not could you close it?

@stale stale bot removed the status:stale Inactive or outdated issues. (auto-assigned) label Dec 10, 2024
@xmfcx
Copy link
Contributor

xmfcx commented Jan 21, 2025

@ito-san I will close this issue since there was no response. Feel free to reopen if necessary.

@xmfcx xmfcx closed this Jan 21, 2025
auto-merge was automatically disabled January 21, 2025 15:42

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:system System design and integration. (auto-assigned) type:bug Software flaws or errors. type:documentation Creating or refining documentation. (auto-assigned) type:new-feature New functionalities or additions, feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants