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

Iox #805 enhance posix call #807

Merged
merged 17 commits into from
May 21, 2021

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented May 20, 2021

Pre-Review Checklist for the PR Author

  1. Code follows the coding style of CONTRIBUTING.md
  2. Tests follow the best practice for testing
  3. Branch follows the naming format (iox-#123-this-is-a-branch)
  4. Commits messages are according to this guideline
    • Commit messages have the issue ID (iox-#123 commit text)
    • Commit messages are signed (git commit -s)
    • Commit author matches Eclipse Contributor Agreement (and ECA is signed)
  5. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  6. Relevant issues are linked
  7. Add sensible notes for the reviewer
  8. All checks have passed (except task-list-completed)
  9. Assign PR to reviewer

Notes for Reviewer

This PR refactors the posixCall to handle a common case were errnos are ignored just to suppress error logging.

Additionaly, the handling of returning the errno value instead of setting the errno is now handled explicit.

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Code according to our coding style and naming conventions
  • Unit tests have been written for new behavior
  • Public API changes are documented via doxygen
  • Copyright owner are updated in the changed files
  • PR title describes the changes

Post-review Checklist for the PR Author

  1. All open points are addressed and tracked via issues

References

@elBoberido elBoberido added enhancement New feature refactoring Refactor code without adding features labels May 20, 2021
@elBoberido elBoberido self-assigned this May 20, 2021
@@ -72,7 +72,7 @@ if(BUILD_TEST)
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE result)
if(result)
message(FATAL_ERROR "CMake step [patch] for googletest failed: ${result}")
message(WARNING "CMake step [patch] for googletest failed: ${result}! Build of gtest might fail")
Copy link
Member Author

Choose a reason for hiding this comment

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

had to do this since I had problems running cmake mutliple times

Copy link
Contributor

Choose a reason for hiding this comment

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

Mmmhhh thats not so nice. Is it possible to run this command only once when we clone the repo and when its already present we skip it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could not find a solution for this but in the end it doesn't matter. If this doesn't stop the build the -Werror does

@codecov
Copy link

codecov bot commented May 20, 2021

Codecov Report

Merging #807 (f8956e1) into master (2414145) will increase coverage by 0.08%.
The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #807      +/-   ##
==========================================
+ Coverage   74.40%   74.49%   +0.08%     
==========================================
  Files         322      323       +1     
  Lines       11532    11521      -11     
  Branches     1956     1950       -6     
==========================================
+ Hits         8580     8582       +2     
+ Misses       2192     2180      -12     
+ Partials      760      759       -1     
Flag Coverage Δ
unittests 73.33% <95.23%> (+0.10%) ⬆️
unittests_timing 31.09% <63.49%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...include/iceoryx_hoofs/posix_wrapper/posix_call.hpp 100.00% <ø> (ø)
iceoryx_posh/source/roudi/process_manager.cpp 60.35% <0.00%> (-0.18%) ⬇️
...eoryx_hoofs/source/posix_wrapper/message_queue.cpp 71.42% <91.66%> (+1.09%) ⬆️
...s/include/iceoryx_hoofs/internal/cxx/algorithm.inl 100.00% <100.00%> (ø)
...ceoryx_hoofs/internal/posix_wrapper/posix_call.inl 100.00% <100.00%> (ø)
iceoryx_hoofs/source/posix_wrapper/file_lock.cpp 36.36% <100.00%> (+4.36%) ⬆️
iceoryx_hoofs/source/posix_wrapper/mutex.cpp 81.25% <100.00%> (ø)
iceoryx_hoofs/source/posix_wrapper/semaphore.cpp 63.90% <100.00%> (ø)
...six_wrapper/shared_memory_object/shared_memory.cpp 65.71% <100.00%> (+0.24%) ⬆️
..._hoofs/source/posix_wrapper/unix_domain_socket.cpp 62.28% <100.00%> (+2.79%) ⬆️
... and 5 more

@elBoberido elBoberido force-pushed the iox-#805-enhance-posixCall branch 2 times, most recently from 061c51f to 04ceec2 Compare May 20, 2021 22:23
@elBoberido elBoberido force-pushed the iox-#805-enhance-posixCall branch from 04ceec2 to 3eddd5f Compare May 20, 2021 22:34
/// @param[in] remainingValueListEntries are the remaining variadic arguments of ValueList
template <typename T, typename... ValueList>
inline constexpr bool
doesContainValue(const T value, const T firstValueListEntry, const ValueList... remainingValueListEntries) noexcept;
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling of déjà vu. Didn't we already implement this helper function? I couldn't find it though.

Copy link
Contributor

Choose a reason for hiding this comment

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

I have the same feeling but maybe I am mixing it up with doesContainType which we use to verify if the cxx::variant contains a certain type.

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't find something similar in helplets or algorithm. Maybe it's buried in some class

Copy link
Contributor

@elfenpiff elfenpiff left a comment

Choose a reason for hiding this comment

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

The API looks even more cleaner now. Thank you.

@@ -72,7 +72,7 @@ if(BUILD_TEST)
WORKING_DIRECTORY "${SOURCE_DIR}"
RESULT_VARIABLE result)
if(result)
message(FATAL_ERROR "CMake step [patch] for googletest failed: ${result}")
message(WARNING "CMake step [patch] for googletest failed: ${result}! Build of gtest might fail")
Copy link
Contributor

Choose a reason for hiding this comment

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

Mmmhhh thats not so nice. Is it possible to run this command only once when we clone the repo and when its already present we skip it?

/// @param[in] remainingValueListEntries are the remaining variadic arguments of ValueList
template <typename T, typename... ValueList>
inline constexpr bool
doesContainValue(const T value, const T firstValueListEntry, const ValueList... remainingValueListEntries) noexcept;
Copy link
Contributor

Choose a reason for hiding this comment

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

I have the same feeling but maybe I am mixing it up with doesContainType which we use to verify if the cxx::variant contains a certain type.

@elBoberido elBoberido force-pushed the iox-#805-enhance-posixCall branch from 6f69fb7 to 41a59a1 Compare May 21, 2021 09:29
@elBoberido elBoberido force-pushed the iox-#805-enhance-posixCall branch from 8f020ea to 28fb7a0 Compare May 21, 2021 10:20
@elBoberido elBoberido force-pushed the iox-#805-enhance-posixCall branch from 50d1890 to f445b3b Compare May 21, 2021 10:47
elfenpiff
elfenpiff previously approved these changes May 21, 2021
@elBoberido elBoberido merged commit e6f5999 into eclipse-iceoryx:master May 21, 2021
@elBoberido elBoberido deleted the iox-#805-enhance-posixCall branch May 21, 2021 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature refactoring Refactor code without adding features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segmentation Fault in FileLock Enhance posixCall
3 participants