-
Notifications
You must be signed in to change notification settings - Fork 388
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
Possibility to block the publisher when subscriber queue is full #615
Comments
Proposed solution
|
@budrus iceperf already does it more or less this way. One appliacation only sends data after it received data from the other, so we already have a blocking wait for the publisher. |
@elBoberido That's somehow right. But only because we have the ping-pong back channel. For a throughput measurement I think other middleware doing a |
@budrus okay, with this approach there will almost certainly be a data loss when the publisher is not blocked since the queue sizes are way to small to hold enough samples even if the OS stops the subscriber only for a few milliseconds. |
I would suggest the following approach.
|
This is great. Anything which doesn’t force or imply a threading model on clients is awesome. |
Hackathon:
|
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>
@budrus with an impossible task |
@ithier at least you realized that I got the hardest job |
Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
…sher/SubscriberPort Signed-off-by: Simon Hoinkis <simon.hoinkis@apex.ai>
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>
Signed-off-by: Christian Eltzschig <me@elchris.org>
…o solve sanitizer issue Signed-off-by: Christian Eltzschig <me@elchris.org>
…ssue Signed-off-by: Christian Eltzschig <me@elchris.org>
… libc++abi.dylib: terminating Signed-off-by: Christian Eltzschig <me@elchris.org>
…er-when-subscriber-queue-full
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
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>
…-queue-full' of https://github.com/ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
…riant queue Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
…-queue-full' of https://github.com/ApexAI/iceoryx into iox-eclipse-iceoryx#615-block-publisher-when-subscriber-queue-full
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…lisher-when-subscriber-queue-full Iox eclipse-iceoryx#615 block publisher when subscriber queue full
…ions example Signed-off-by: Michael Poehnl <michael.poehnl@apex.ai>
… by full subscriber queue Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…ouDi-shutdown-with-blocked-publisher iox-eclipse-iceoryx#615 unblock RouDi shutdown with blocked publisher
…lisher-when-subscriber-queue-full Iox eclipse-iceoryx#615 block publisher when subscriber queue full
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
Signed-off-by: Mathias Kraus <mathias.kraus@apex.ai>
…ouDi-shutdown-with-blocked-publisher Iox eclipse-iceoryx#615 unblock roudi shutdown with blocked publisher
Brief feature description
Today our default is to use an "overflowing queue" for the subscribers. If the subscriber does not consume fast enough we start loosing samples. An option would be nice to block the publisher in this case for ensuring that no samples are lost.
Detailed information
The overflowing queue starts to drop the oldest sample in case of an overflow, so technically it behaves like a ring buffer. In many use cases this is fine as we want to have a "provide the last X samples" contract. E.g. if a subscriber is only interested in latest greatest data, they can set the queue size to 1 and we don't waste memory chunks with samples that are not interesting for the subscriber. We often also do not want to have an interference from a subscriber back to a publisher. So if the subscriber is not fast enough to consume all samples solutions could be
But there also might be use cases where it is fine to slow down the publisher to ensure that no data is lost in our system. The solution would be to block the
publish()
call when we detect a queue overflow until the subscriber popped samples and there is again a free slot in the queue. Sure, this has an influence on the publishing applications ans also other subscribers that are connected to this publisher. This is comparable to the DDS history QoS KeepAll. The normal behavior with our overflowing queue is comparable to the DDS history QoS KeepLastXToDo
When implemented implement the following integration tests:
ChunkDistributor
Iox #615 block publisher when subscriber queue full #663 (comment)TriggerQueue
Iox #615 block publisher when subscriber queue full #663 (comment)Ctrl+C
on an application with an publisher blocked by a slow subscriber doesn't shut down when a signal handler is installed; this is due to thewhile (!remainingQueues.empty())
inChunkDistributor::deliverToAllStoredQueues
which is not stopped whenSIG_TERM
has a custom signal handlerRuntime::unblockShutdown
could be implementedprocessKillDelay
inRouDi::shutdown
methodm_prcMgr->requestShutdownOfAllProcesses();
RouDi has to make all the publisher stop offering so that the discovery loop can remove the subscriber queues from theChunkDistributor
of the publisherThe text was updated successfully, but these errors were encountered: