Skip to content

HISTORY QoS Problem #49

Description

@jwcesign

Hi,
In my expriment, I want to test HISTORY QoS, but when I test, it seems not work as I want.
Here is the description of HISTORY QoS in OMG specification.

If the kind is set to KEEP_ALL, then the Service will attempt to maintain and deliver all the values of the instance to existing subscribers. The resources that the Service can use to keep this history are limited by the settings of the RESOURCE_LIMITS QoS. If the limit is reached, then the behavior of the Service will depend on the RELIABILITY QoS. If the reliability kind is BEST_EFFORT, then the old values will be discarded. If reliability is RELIABLE, then the Service will block the DataWriter until it can deliver the necessary old values to all subscribers.

So I set the datawriter QoS as belows and change helloworld examples

#dw qos
    dwQos = dds_qos_create ();
    dds_qset_reliability (dwQos, DDS_RELIABILITY_RELIABLE, DDS_INFINITY);
    dds_qset_history (dwQos, DDS_HISTORY_KEEP_ALL, 0);
    dds_qset_resource_limits (dwQos, 100, DDS_LENGTH_UNLIMITED, DDS_LENGTH_UNLIMITED);
#my idl
	module HelloWorldData
	{
	  struct Msg
	  {
	    long userID;
	    string message;
	  };
	  #pragma keylist Msg userID
	};
#my write opretion
    msg.userID = 1;
    char s;
    printf ("=== [Publisher]  Writing : ");
    for (int i=0;i<50;i++)
    {
        s = (char)i;
        msg.message = &s;
        ret = dds_write (writer, &msg);
        DDS_ERR_CHECK (ret, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
        printf ("Message (%d, %d)\n", msg.userID, *msg.message);
        dds_sleepfor (DDS_MSECS (1000));
    }

As I think, all the msgs I write belongs to the same instance, so all the samples will be saved until all the samples are received by the subscriber's reader.
And I do expriment as belows:
(1)Run two docker containers and bridge to the same network interface---docker0.
(2)container_1 run HelloworldPublisher, then container_2 run HelloworldSubscriber.
(3)container_2 will receive message and till message 20, I use ifconfig docker0 down to turn off the network interface.
(4)container_2 will stop receiving data.
(5)I use ifconfig docker0 up to turn on the networkinterface.
(6)container_2 will start to receive message again, but the message starts from message 28.

So my problem is that container_2 doesn't receive message21-27, but in the specification, it said should receive all.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions