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(compare_map_segmentation): add missing mutex lock #9097

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

badai-nguyen
Copy link
Contributor

@badai-nguyen badai-nguyen commented Oct 17, 2024

Description

Related links

Parent Issue:

How was this PR tested?

Tested in Autoware Evaluator
image

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test labels Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@veqcc
Copy link
Contributor

veqcc commented Oct 17, 2024

@badai-nguyen
At first, please change the variable name mutex_ptr_ so that which data structure is protected by it.

@badai-nguyen badai-nguyen added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 17, 2024
@badai-nguyen badai-nguyen force-pushed the fix/bug/compare_map_segmentation branch from e448739 to 0d6d565 Compare October 17, 2024 05:35
Signed-off-by: badai-nguyen <[email protected]>
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

Attention: Patch coverage is 32.25806% with 21 lines in your changes missing coverage. Please review.

Project coverage is 27.33%. Comparing base (06adbc4) to head (1f3b680).

Files with missing lines Patch % Lines
...rc/voxel_grid_map_loader/voxel_grid_map_loader.hpp 0.00% 7 Missing ⚠️
...rc/voxel_grid_map_loader/voxel_grid_map_loader.cpp 50.00% 2 Missing and 1 partial ⚠️
...ion/src/distance_based_compare_map_filter/node.cpp 33.33% 1 Missing and 1 partial ⚠️
...ion/src/distance_based_compare_map_filter/node.hpp 33.33% 2 Missing ⚠️
...c/voxel_distance_based_compare_map_filter/node.cpp 33.33% 1 Missing and 1 partial ⚠️
...c/voxel_distance_based_compare_map_filter/node.hpp 33.33% 2 Missing ⚠️
...oxel_based_approximate_compare_map_filter/node.cpp 50.00% 1 Missing ⚠️
...oxel_based_approximate_compare_map_filter/node.hpp 50.00% 1 Missing ⚠️
...tation/src/voxel_based_compare_map_filter/node.cpp 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9097      +/-   ##
==========================================
- Coverage   28.26%   27.33%   -0.94%     
==========================================
  Files        1306     1304       -2     
  Lines      101091    95745    -5346     
  Branches    39243    39036     -207     
==========================================
- Hits        28573    26168    -2405     
+ Misses      69761    66968    -2793     
+ Partials     2757     2609     -148     
Flag Coverage Δ *Carryforward flag
differential 7.62% <32.25%> (?)
total 27.36% <ø> (-0.91%) ⬇️ Carriedforward from 8ecc139

*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.

@veqcc
Copy link
Contributor

veqcc commented Oct 17, 2024

Isn't is necessary to take a mutex here?

  if (current_voxel_grid_dict_.size() == 0) {
    return false;
  }

Signed-off-by: badai-nguyen <[email protected]>
Signed-off-by: badai-nguyen <[email protected]>
@badai-nguyen badai-nguyen marked this pull request as ready for review October 17, 2024 23:14
Signed-off-by: badai-nguyen <[email protected]>
@badai-nguyen badai-nguyen force-pushed the fix/bug/compare_map_segmentation branch from 7bed7df to 061359e Compare October 20, 2024 11:13
@veqcc
Copy link
Contributor

veqcc commented Oct 21, 2024

Strictly speaking, relaxed memory ordering is enough here (I think), but stricter ordering will not invoke a bug, so I will admit it.

is_initialized_.load(std::memory_order_acquire)

After you check the result of Autoware Evaluator again, I will approve this PR!!

@badai-nguyen
Copy link
Contributor Author

@veqcc I recheck this update on Evaluator again and all tests were passed. https://evaluation.tier4.jp/evaluation/reports/1e5dd036-27fa-5480-b44f-b4ef14d6aa3d?project_id=prd_jt

Copy link
Contributor

@veqcc veqcc left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@badai-nguyen
Copy link
Contributor Author

@yukkysaito Could you review this PR as codeowner?

@yukkysaito
Copy link
Contributor

The code itself seems fine. However, I haven't thoroughly checked whether the resources being locked are appropriate.
Is it correct to assume that the mutual exclusion control was reviewed by @veqcc ?

@veqcc
Copy link
Contributor

veqcc commented Oct 22, 2024

The code itself seems fine. However, I haven't thoroughly checked whether the resources being locked are appropriate.
Is it correct to assume that the mutual exclusion control was reviewed by @veqcc ?

Yes it is.
But I think it's worth being double checked. If you approved it, you are responsible for the codebase. If you do not have enough time for checking it thoroughly, please assign somebody else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:perception Advanced sensor data processing and environment understanding. (auto-assigned) tag:require-cuda-build-and-test tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
Status: To triage
Development

Successfully merging this pull request may close these issues.

3 participants