-
Notifications
You must be signed in to change notification settings - Fork 379
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
Iox #27 server port implementation preparatory #894
Conversation
iceoryx_posh/include/iceoryx_posh/internal/popo/building_blocks/chunk_distributor.hpp
Outdated
Show resolved
Hide resolved
6503b29
to
c7bebf4
Compare
c7bebf4
to
908deea
Compare
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
4528310
to
0c86a01
Compare
b788f15
to
4fa3da6
Compare
/// @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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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)) |
There was a problem hiding this comment.
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.
1b697dc
to
2473871
Compare
16347c7
to
1d4c1cd
Compare
1d4c1cd
to
7513b83
Compare
Pre-Review Checklist for the PR Author
iox-#123-this-is-a-branch
)iox-#123 commit text
)git commit -s
)task-list-completed
)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
Post-review Checklist for the PR Author
References