Comments (7)
We first supported only the AUTOSAR Adaptive API. There a history of 1 is called ‚field‘ and the contract is that it always has a value. I.e. a subscriber has to get a sample on subscription. We introduced this check to recognize if the contract is not fulfilled.
This makes no sense in a DDS / ROS2 context. We will change this, may take some days because of current circumstances. So far it should be fine if you just comment the check
from iceoryx.
you can also just allocate and send a sample before doing the offering
from iceoryx.
Thanks @evshary . This is a nice topic.
In this example we create a publisher, then we enter a loop where we publish the counter and wait for 1 sec. If you first start the subscriber it will be connected by a discovery loop in the daemon as soon as this detects the publisher.
As the discovery loop has a cycle of 100 ms, you loose the first sample from the publisher that is sent immediately after creating the publisher (somehow a race). The default contract is that a subscriber will get all the samples as soon as it is subscribed. If you do not want to loose samples you need what is called history QoS in DDS, I guess.
We currently already support a history of 1. This can be enabled with the publisher method enableDoDeliverOnSubscription().
So if you enable this functionality in the c'tor of the TypedPublisher
https://github.com/eclipse/iceoryx/blob/master/iceoryx_examples/icedelivery/a_typed_api.hpp#L45
like this
TypedPublisher(const iox::capro::ServiceDescription& id)
: m_publisher(id)
{
m_publisher.offer();
m_publisher.enableDoDeliverOnSubscription();
}
it should be fine.
This "fixes" the problem in this example. Currently we only support a history of 1. But we already started a refactoring that would allow to configure a variable history size when creating publishers and subscribers
from iceoryx.
@michael-poehnl Thanks for your answer. I'll close the issue.
from iceoryx.
@michael-poehnl Sorry for reopen the issue.
I face a problem while using enableDoDeliverOnSubscription()
.
RouDi may crash if the time interval between enableDoDeliverOnSubscription()
and actual publish is large.
For example, here is the modification based on ice_publisher_bare_metal.cpp
....
myPublisher.offer();
myPublisher.enableDoDeliverOnSubscription();
sleep(2); // create a large time interval
uint32_t ct = 0;
while (!killswitch)
{
....
The crash log is like the following.
2020-03-26 13:57:24.595 [ Error ]: ICEORYX error! POSH__SENDERPORT_FIELD_SUBSCRIBE_WITHOUT_DATA
RouDi: /home/chenying/workspace/iceoryx_ws/src/iceoryx/iceoryx_utils/source/error_handling/error_handling.cpp:53: static void iox::ErrorHandler::ReactOnErrorLevel(iox::ErrorLevel, const char*): Assertion `false' failed.
[1] 27138 abort (core dumped) ./RouDi
This error is related to here.
https://github.com/eclipse/iceoryx/blob/master/iceoryx_posh/include/iceoryx_posh/internal/popo/receiver_handler.inl#L139
I guess the error indicates there is no data to transmit while adding new receiver and doDeliverOnSubscription(History of 1) is enable.
IMHO, maybe we don't need to generate error here. History of 1 doesn't mean there must be data while new receiver subscribes.
from iceoryx.
This will change in #25, so we can close this issue once we finalized #25
from iceoryx.
Closing this issue, as iceoryx 1.0 release (with #25) is on the horizon.
from iceoryx.
Related Issues (20)
- While setting the acquired shared memory to zero a fatal SIGBUS signal appeared caused by memset. HOT 5
- how to support string using zero-copy transport HOT 1
- Add 'iox' prefix to all functions and types in the platform abstraction
- SingleProcess example crashes on QNX HOT 4
- : backtrace: HOT 2
- Is `libatomic` still required to build Iceoryx? HOT 7
- Some questions about IndexQueue. HOT 10
- Feature request: print the number of ports in the introspection client
- 32-Bit Support
- How to handle messages in parallel with popo::listener? HOT 3
- Is there a cost comparison between serialization app and roudi with protobuf or other efficient implementation HOT 2
- iox-roudi throws POPO__CHUNK_LOCKING_ERROR when killing a process mid-publish HOT 6
- Ongoing Issue: Small Documentation Tasks
- publisher got error after loaned 8 sample HOT 2
- Race condition between ProbeProcessAliveWithSigTerm in RouDi and SignalWatcher singleton in applications HOT 5
- Out-of-bounds memory access in UsedChunkList HOT 9
- Request server received no valid server port from RouDi HOT 2
- It is possible to specify a queue size greater than 256 HOT 2
- Move iceoryx2 cxx addendum headers into iceoryx
- iox::function claims to support moving functions, but doesn't HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iceoryx.