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 #33 implement uds with named pipes #820

Merged

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented May 28, 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

It is important that you start your review with test_unix_domain_sockets.cpp - for no reasons.

The NamedPipe does not come with a unit test. The reason is that it is implemented so that it is compatible with IpcChannel which is in the end a message queue. This is far from perfect and has to be refactored - see issue #832
The IpcChannel tests suffices in this particular case.

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

  • Closes TBD

@codecov
Copy link

codecov bot commented May 29, 2021

Codecov Report

Merging #820 (48e33ae) into master (ea6ea66) will increase coverage by 0.13%.
The diff coverage is 83.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #820      +/-   ##
==========================================
+ Coverage   75.01%   75.14%   +0.13%     
==========================================
  Files         328      330       +2     
  Lines       11705    11856     +151     
  Branches     1965     2001      +36     
==========================================
+ Hits         8780     8909     +129     
- Misses       2165     2179      +14     
- Partials      760      768       +8     
Flag Coverage Δ
unittests 74.00% <83.52%> (+0.14%) ⬆️
unittests_timing 30.60% <19.31%> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
...eoryx_hoofs/include/iceoryx_hoofs/cxx/helplets.hpp 86.84% <ø> (ø)
...oofs/source/posix_wrapper/shared_memory_object.cpp 69.64% <ø> (ø)
...eoryx_posh/internal/runtime/ipc_interface_base.hpp 100.00% <ø> (ø)
iceoryx_posh/source/runtime/shared_memory_user.cpp 5.71% <0.00%> (ø)
iceoryx_posh/source/runtime/ipc_interface_base.cpp 59.30% <14.28%> (ø)
iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp 83.33% <83.33%> (ø)
...fs/include/iceoryx_hoofs/internal/cxx/helplets.inl 93.47% <93.47%> (ø)
...oofs/include/iceoryx_hoofs/internal/cxx/string.inl 98.63% <100.00%> (-0.02%) ⬇️
..._hoofs/source/posix_wrapper/unix_domain_socket.cpp 62.38% <100.00%> (-0.33%) ⬇️
...fs/internal/posix_wrapper/shared_memory_object.hpp 66.66% <0.00%> (-33.34%) ⬇️
... and 2 more

@elfenpiff elfenpiff force-pushed the iox-#33-implement-uds-with-named-pipes branch from 55e43a5 to 8ec2fc0 Compare June 1, 2021 09:54
@elfenpiff elfenpiff marked this pull request as ready for review June 1, 2021 09:58
Copy link
Contributor

@FerdinandSpitzschnueffler FerdinandSpitzschnueffler left a comment

Choose a reason for hiding this comment

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

Not finished, but after reviewing the tests I have to consult the glory hypnotoad...

@elfenpiff elfenpiff self-assigned this Jun 2, 2021
@elfenpiff elfenpiff linked an issue Jun 2, 2021 that may be closed by this pull request
7 tasks
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Reviewed everything but the actual named pipe implementation. This has to wait till tomorrow

iceoryx_posh/include/iceoryx_posh/iceoryx_posh_types.hpp Outdated Show resolved Hide resolved
iceoryx_hoofs/source/posix_wrapper/unix_domain_socket.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/test/moduletests/test_cxx_helplets.cpp Outdated Show resolved Hide resolved
@elfenpiff elfenpiff requested a review from elBoberido June 8, 2021 10:43
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

The actual named pipe implementation is still not reviewed. Will do it after lunch

constexpr const char IOX_PATH_SEPARATORS[] = "/";
constexpr uint64_t IOX_UDS_SOCKET_MAX_MESSAGE_SIZE = 4096;
constexpr char IOX_UDS_SOCKET_PATH_PREFIX[] = "/tmp/";
using IoxIpcChannelType = iox::posix::UnixDomainSocket;
Copy link
Member

Choose a reason for hiding this comment

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

While I somehow understand the reasoning for this, I'm not quite sure if this is a good idea. It uses knowledge from a higher level to define something which is only used even more up in the stack. Maybe it's the lesser evil but I have to think a bit more about it.

iceoryx_hoofs/platform/win/source/mman.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/platform/win/source/mman.cpp Outdated Show resolved Hide resolved
@elfenpiff elfenpiff requested a review from elBoberido June 8, 2021 13:32
Copy link
Member

@elBoberido elBoberido left a comment

Choose a reason for hiding this comment

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

Almost there, just a few minor issues left

iceoryx_hoofs/platform/win/source/mman.cpp Outdated Show resolved Hide resolved

/// @brief For compatibility with IpcChannel alias, default ctor which creates
/// an uninitialized NamedPipe.
NamedPipe() noexcept;
Copy link
Member

Choose a reason for hiding this comment

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

Not required for this PR, but we need to get rid of this and use cxx::optional<IpcChannel> everywhere this is used

iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp Outdated Show resolved Hide resolved
iceoryx_hoofs/source/posix_wrapper/named_pipe.cpp Outdated Show resolved Hide resolved
@elfenpiff elfenpiff requested a review from elBoberido June 8, 2021 16:33
elBoberido
elBoberido previously approved these changes Jun 8, 2021
elfenpiff added 5 commits June 9, 2021 09:28
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…hm_open, removed cmd line parser from roudi app in windows

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…ctions

Signed-off-by: Christian Eltzschig <me@elchris.org>
elfenpiff added 14 commits June 9, 2021 09:28
…ameValid, moved platform implementation config into platform settings

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…f for pagesize in windows, added explanatory comments

Signed-off-by: Christian Eltzschig <me@elchris.org>
…yx prefix for windows user/group dummys, removed unnecessary type alias IpcChannelType

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…and only reserve SHM in windows, improved code readability

Signed-off-by: Christian Eltzschig <me@elchris.org>
…ings

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…ng the shared memory, introduce warning message if sockets are used in windows, mask 32-bit high/low conversion to futureproof code

Signed-off-by: Christian Eltzschig <me@elchris.org>
…ce error message on startup/cleanup in windows

Signed-off-by: Christian Eltzschig <me@elchris.org>
…fix to named_pipe, use Duration::max for infinite timeout

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff force-pushed the iox-#33-implement-uds-with-named-pipes branch from b6fd803 to 6a92042 Compare June 9, 2021 07:28
@elfenpiff elfenpiff requested a review from elBoberido June 9, 2021 07:29
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
@elBoberido elBoberido force-pushed the iox-#33-implement-uds-with-named-pipes branch from cf061b2 to 4f901b0 Compare June 9, 2021 12:04
elBoberido
elBoberido previously approved these changes Jun 9, 2021
TEST_F(UnixDomainSocket_test, SuccessfulCommunicationOfMultipleMessagesWithSendAndTimedReceive)
{
successfulSendAndReceive(
{"most famous actors and politicians claim that the licked hypnotoad which was later the key to their "
Copy link
Contributor

Choose a reason for hiding this comment

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

they licked hypnotoad...

Signed-off-by: Christian Eltzschig <me@elchris.org>
@elfenpiff elfenpiff merged commit 7697383 into eclipse-iceoryx:master Jun 9, 2021
@elfenpiff elfenpiff deleted the iox-#33-implement-uds-with-named-pipes branch June 9, 2021 14:10
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.

Basic Windows 10 support
3 participants