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

Unable to Send Large Strings of Size 4096 bytes [14846] #2740

Closed
1 task done
paulbkeelp opened this issue Jun 9, 2022 · 4 comments
Closed
1 task done

Unable to Send Large Strings of Size 4096 bytes [14846] #2740

paulbkeelp opened this issue Jun 9, 2022 · 4 comments

Comments

@paulbkeelp
Copy link

Is there an already existing issue for this?

  • I have searched the existing issues

Expected behavior

Expected to Send Large Strings

Current behavior

Unable to Send Large Strings of Size 4096 bytes

We need to send Large Strings(json format) from publisher to susbcriber before converting in to Json at subscriber end. we are unable to send this much size of data.

Steps to reproduce

Send any Large size of strings

Fast DDS version/commit

Latest

Platform/Architecture

Ubuntu Focal 20.04 amd64

Transport layer

UDPv4

Additional context

No response

XML configuration file

No response

Relevant log output

No response

Network traffic capture

No response

@paulbkeelp paulbkeelp added the triage Issue pending classification label Jun 9, 2022
@paulbkeelp paulbkeelp reopened this Jun 9, 2022
@JLBuenoLopez JLBuenoLopez added need more info Issue that requires more info from contributor and removed triage Issue pending classification labels Jun 13, 2022
@JLBuenoLopez
Copy link
Contributor

Hi @paulbkeelp

Could you please provide some more information about the steps you are taking? How can your use issue be reproduced? Fast DDS is a complex library with a lot of settings. Fast DDS CI includes tests checking the sending of large data messages so it is probable that it is something related to your Fast DDS setup. Some basic information that would be helpful will be:

  • IDL file you are using. Are you generating the Type Support with Fast DDS-Gen?
  • QoS settings (either by code or the XML file you are using).
  • A small reproducer or some steps that we can follow to reproduce your issue.

Thanks in advance!

@JLBuenoLopez JLBuenoLopez changed the title Unable to Send Large Strings of Size 4096 bytes Unable to Send Large Strings of Size 4096 bytes [14846] Jun 13, 2022
@paulbkeelp
Copy link
Author

Dear @JLBuenoLopez-eProsima Thank you for your message. Please find the requested info
IDL :
struct InfoMessage
{
string message
short type;
};

Sample Source code for the properties :

auto udp_transport = std::make_shared<eprosima::fastdds::rtps::UDPv4TransportDescriptor>();
participant_ptr->transport().user_transports.push_back(udp_transport);
participant_ptr->transport().use_builtin_transports = false;

m_participant =
    DomainParticipantFactory::get_instance()->create_participant(0, *participant_ptr.get());

m_commandMessagetype.register_type(m_participant);  /// type as per the above IDL
m_infoMessagetype.register_type(m_participant);

// Create the subscription Topic
m_topicCommandMessageSub = m_participant->create_topic(sub, "InfoMessage", TOPIC_QOS_DEFAULT);
if (m_topicCommandMessageSub == nullptr)
{
    return false;
}

// Create the publish Topic
m_topicInfoMessagePub =  m_participant->create_topic(pub, "CommandMessage", TOPIC_QOS_DEFAULT);
if (m_topicInfoMessagePub == nullptr)
{
    return false;
}

// Create the Subscriber
m_subscriber = m_participant->create_subscriber(SUBSCRIBER_QOS_DEFAULT, nullptr);
if (m_subscriber == nullptr)
{
    return false;
}

// Create the DataReader
m_reader = m_subscriber->create_datareader(m_topicCommandMessageSub, DATAREADER_QOS_DEFAULT, &m_infoMessageSubListener);
if (m_reader == nullptr)
{
    return false;
}


// Create the Publisher
m_publisher = m_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr);
if (m_publisher == nullptr)
{
// Create the Publisher
m_publisher = m_participant->create_publisher(PUBLISHER_QOS_DEFAULT, nullptr);
if (m_publisher == nullptr)
{
    return false;
}

// Create the DataWriter
m_writer = m_publisher->create_datawriter(m_topicInfoMessagePub, DATAWRITER_QOS_DEFAULT, &m_commandMessagePubListener);
if (m_writer == nullptr)
{
        return false;
}

What We are writing :
Large Json string - If we write the large json formared string with large size around 4k
ex format - std::string val = "{"stringval": "my large string say 4k bytes "}";
if (&m_commandMessagePubListener.matched_ > 0)
{
m_commandMessagePubType.message() =
m_commandMessagePubType.type() = 1000;
m_writer->write(&m_commandMessagePubType);
return true;
}

@JLBuenoLopez JLBuenoLopez added duplicate and removed need more info Issue that requires more info from contributor labels Jun 13, 2022
@JLBuenoLopez
Copy link
Contributor

Hi @paulbkeelp,

Probably your issue is a duplicate of #2330. There you have the answer: you should modify the memory management policy to PREALLOCATED_WITH_REALLOC_MEMORY_MODE.

If this solves your issue be so kind to close it. Thanks!

@paulbkeelp
Copy link
Author

@JLBuenoLopez-eProsima Thanks for the speedy response. I wil have a look and test with the change. I will get back to you after my testing. I will now close this for now.

Many Thanks

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

No branches or pull requests

2 participants