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 #27 server port implementation preparatory #894

Conversation

elBoberido
Copy link
Member

@elBoberido elBoberido commented Aug 2, 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. Changelog updated in the unreleased section including API breaking changes
  4. Branch follows the naming format (iox-#123-this-is-a-branch)
  5. 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)
  6. Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  7. Relevant issues are linked
  8. Add sensible notes for the reviewer
  9. All checks have passed (except task-list-completed)
  10. Assign PR to reviewer

Notes for Reviewer

This is a preparatory PR for the server port implementation in order to keep that PR small.

The ChunkSender, ChunkDistributor and RpcHeader are extended with the functionality needed by the ServerPort. Additionally, the ServerPortOptions are added.

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 self-assigned this Sep 13, 2021
@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch from 6503b29 to c7bebf4 Compare September 13, 2021 21:53
This was referenced Jan 6, 2022
@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch from c7bebf4 to 908deea Compare January 6, 2022 15:45
@codecov
Copy link

codecov bot commented Jan 6, 2022

Codecov Report

Merging #894 (7513b83) into master (b45d65e) will increase coverage by 0.05%.
The diff coverage is 96.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #894      +/-   ##
==========================================
+ Coverage   76.96%   77.01%   +0.05%     
==========================================
  Files         342      343       +1     
  Lines       12425    12475      +50     
  Branches     1845     1856      +11     
==========================================
+ Hits         9563     9608      +45     
- Misses       2242     2243       +1     
- Partials      620      624       +4     
Flag Coverage Δ
unittests 76.24% <96.72%> (+0.07%) ⬆️
unittests_timing 12.28% <0.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
...nternal/popo/building_blocks/chunk_distributor.hpp 100.00% <ø> (ø)
...osh/internal/popo/building_blocks/chunk_sender.hpp 100.00% <ø> (ø)
...nternal/popo/building_blocks/chunk_distributor.inl 92.06% <93.75%> (+0.22%) ⬆️
...de/iceoryx_posh/internal/mepoo/segment_manager.inl 86.66% <100.00%> (-1.47%) ⬇️
...osh/internal/popo/building_blocks/chunk_sender.inl 90.47% <100.00%> (+1.00%) ⬆️
...ceoryx_posh/source/popo/ports/client_port_user.cpp 96.22% <100.00%> (ø)
iceoryx_posh/source/popo/rpc_header.cpp 100.00% <100.00%> (ø)
iceoryx_posh/source/popo/server_options.cpp 100.00% <100.00%> (ø)
iceoryx_hoofs/source/posix_wrapper/timer.cpp 62.44% <0.00%> (-0.85%) ⬇️
... and 1 more

@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch 5 times, most recently from 4528310 to 0c86a01 Compare January 7, 2022 17:54
@elBoberido elBoberido changed the title Iox #27 server port implementation preparatory [do not review before #1011 is merged] Iox #27 server port implementation preparatory Jan 7, 2022
@elBoberido elBoberido marked this pull request as ready for review January 7, 2022 18:01
@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch 4 times, most recently from b788f15 to 4fa3da6 Compare January 11, 2022 13:28
@elBoberido elBoberido changed the title [do not review before #1011 is merged] Iox #27 server port implementation preparatory Iox #27 server port implementation preparatory Jan 11, 2022
@elBoberido elBoberido added the enhancement New feature label Jan 11, 2022
/// @param[in] uniqueQueueId is an unique ID which identifies the queue to which this chunk shall be delivered
/// @param[in] lastKnownQueueIndex is used for a fast lookup of the queue with uniqueQueueId
/// @param[in] chunk is the SharedChunk to be delivered
/// @return ChunkDistributorError if the queue was not found
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when to queue would overflow? Can this happen?

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course. It can also happen that the call is blocking. This all depends on the SubscriberTooSlowPolicy and QueueFullPolicy

/// @param[in] lastKnownQueueIndex is used for a fast lookup of the queue with uniqueQueueId
/// @return true when successful, false otherwise
/// @note This method does not add the chunk to the history
bool sendToQueue(mepoo::ChunkHeader* const chunkHeader,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it valid to have the nullptr as argument for chunkHeader? If not I would change the chunkHeader argument into a reference to communicate this to the user that this is never a nullptr.

The same argument goes also for the other methods but you did not touch the fishy, but if you touch the fishy you can turn the pointer into a reference.

https://www.youtube.com/watch?v=8gdsueMGUfk

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it is the same behavior as with ChunkSender::send. One can argue if that is the desired behavior but since that can easily becomes a bottomless pit I would argue it should be discussed/implemented in a separate issue.

{
mepoo::SharedChunk chunk(nullptr);
// BEGIN of critical section, chunk will be lost if the process terminates in this section
if (getChunkReadyForSend(chunkHeader, chunk))
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens when chunkHeader == nullptr?

Copy link
Member Author

Choose a reason for hiding this comment

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

Then getChunkReadyForSend will return false and the error handler will be called

serverOptions.requestQueueCapacity, serverOptions.nodeName, serverOptions.offerOnCreate, clientTooSlowPolicy);

if (!deserializationSuccessful
|| clientTooSlowPolicy > static_cast<ClientTooSlowPolicyUT>(ConsumerTooSlowPolicy::DISCARD_OLDEST_DATA))
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer the approach of adding an additional enum called END and then one can add additional enum values without touching any piece of code.

@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch from 1b697dc to 2473871 Compare January 18, 2022 17:13
@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch 2 times, most recently from 16347c7 to 1d4c1cd Compare January 20, 2022 10:15
@elBoberido elBoberido force-pushed the iox-#27-server-port-implementation-preparatory branch from 1d4c1cd to 7513b83 Compare January 20, 2022 12:59
@elBoberido elBoberido merged commit dfb6857 into eclipse-iceoryx:master Jan 21, 2022
@elBoberido elBoberido deleted the iox-#27-server-port-implementation-preparatory branch January 21, 2022 11:12
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.

Request/Response communication with iceoryx
4 participants