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 #615 block publisher when subscriber queue full #663

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Mar 31, 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

  • Enables the user to implement blocking publishers, which do a busy wait till the subscriber has fetched some data

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

Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…ueFullPolicy

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…nd let RouDi compare it in the discovery loop
Signed-off-by: Christian Eltzschig <me@elchris.org>
…-queue-full' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
Signed-off-by: Christian Eltzschig <me@elchris.org>
…-queue-full' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…sher/SubscriberPort

Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…processMessage,

add tests

Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…:n sofi

Signed-off-by: Christian Eltzschig <me@elchris.org>
…-queue-full' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…-queue-full' of github.com:ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…PortMangerTest

Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…tions

Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
Signed-off-by: Marika Lehmann <marika.lehmann@apex.ai>
…x data types

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…with an integration test

Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
Signed-off-by: Christian Eltzschig <me@elchris.org>
… libc++abi.dylib: terminating

Signed-off-by: Christian Eltzschig <me@elchris.org>
@elBoberido elBoberido changed the base branch from release_1.0 to master April 3, 2021 10:34
@elBoberido elBoberido changed the base branch from master to release_1.0 April 3, 2021 10:34
Signed-off-by: Dietrich Krönke <dietrich.kroenke@apex.ai>
Signed-off-by: Dietrich Krönke <dietrich.kroenke@apex.ai>
@@ -38,7 +38,8 @@ struct ClientPortData : public BasePortData
mepoo::MemoryManager* const memoryManager,
const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept;


static constexpr SubscriberTooSlowPolicy CLIENT_SUBSCRIBER_POLICY = SubscriberTooSlowPolicy::DISCARD_OLDEST_DATA;
static constexpr QueueFullPolicy CLIENT_PUBLISHER_POLICY = QueueFullPolicy::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 feel we should have new enums for clients and servers. They are reusing ChunkSender and ChunkReceiver but have nothing to do with Publisher and Subscriber

Copy link
Contributor

Choose a reason for hiding this comment

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

This is no blocker, as client and server is not yet fully implemented. So this can be changed later

@@ -38,7 +38,8 @@ struct ServerPortData : public BasePortData
mepoo::MemoryManager* const memoryManager,
const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept;


static constexpr SubscriberTooSlowPolicy SERVER_SUBSCRIBER_POLICY = SubscriberTooSlowPolicy::DISCARD_OLDEST_DATA;
static constexpr QueueFullPolicy SERVER_PUBLISHER_POLICY = QueueFullPolicy::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.

same same

Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
{
return m_queue->empty();
return m_queue.pop();
Copy link
Member

Choose a reason for hiding this comment

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

This will make the ActiveObject::mainLoop burn the CPU since it relied on this to be blocking.

Comment on lines +164 to +165
std::sort(getMembers()->m_queues.begin(), getMembers()->m_queues.end());
std::sort(remainingQueues.begin(), remainingQueues.end());
Copy link
Member

Choose a reason for hiding this comment

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

this could also be optimized if we sort the queues once when they are subscribed

elBoberido and others added 8 commits April 3, 2021 14:18
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…en chunks are lost

Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…riant queue

Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
@elBoberido elBoberido force-pushed the iox-#615-block-publisher-when-subscriber-queue-full branch from 069ff11 to 600aa77 Compare April 3, 2021 13:37
@budrus budrus self-requested a review April 3, 2021 14:02
@budrus budrus merged commit a429050 into eclipse-iceoryx:release_1.0 Apr 3, 2021
marthtz pushed a commit to boschglobal/iceoryx that referenced this pull request May 12, 2021
…lisher-when-subscriber-queue-full

Iox eclipse-iceoryx#615 block publisher when subscriber queue full
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibility to block the publisher when subscriber queue is full
6 participants