eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.66k stars 388 forks source link

VariantQueue does not implement setCapacity for FiFo_SingleProducerSingleConsumer #1147

Open elBoberido opened 2 years ago

elBoberido commented 2 years ago

Required information

Operating system: all

Compiler version: all

cmake flags: -DONE_TO_MANY_ONLY=ON

Observed result or behaviour:

running ./posh_moduletests --gtest_filter=PoshRuntime_test.GetMiddlewareSubscriberWithQueueFullPolicySetToBlockPublisherLeadsToBlockPublisher results in a SIGABRT

Expected result or behaviour: Test should pass

Conditions where it occurred / Performed steps:

From variant_queu.inl

case VariantQueueTypes::FiFo_SingleProducerSingleConsumer:
{
    /// @todo must be implemented for FiFo
    assert(false);
    return false;
}
elBoberido commented 2 years ago

@budrus something for v2? It seems to be triggered in combination with QueueFullPolicy::BLOCK_PRODUCER ... well, of course. With other policies the SoFi_SingleProducerSingleConsumer queue is used

budrus commented 2 years ago

@elBoberido We set the capacity during runtime with setCapacity() (Setting it in the c'tor would be sufficient as it comes with the options). I would assume we did not use FiFo_SingleProducerSingleConsumer in the past in our ports, or? Or maybe we jsut had no test for the combination QueueFullPolicy::BLOCK_PRODUCER and OneToManyPolicy I'm not sure how much effort a setCapacity() for the FiFo_SingleProducerSingleConsumer is but what would also work is to use the FiFo_MultiProducerSingleConsumer, or? Would be an upgrade for the client but not a problem

elBoberido commented 2 years ago

@budrus I think currently we do not even build iceoryx with this option in the CI. Maybe we should make this a runtime choice instead of a compile time choice. Using the FiFo_MultiProducerSingleConsumer and just adding a flag to the PublisherOptions would fix the problem ... well, maybe we need to add it to the ServiceDescription else one could already have started multiple publisher without the flag