rmw_fastrtps icon indicating copy to clipboard operation
rmw_fastrtps copied to clipboard

__rmw_boxrrow_loaned_message works and after some time starts to return RMW_RET_ERROR

Open benbarron opened this issue 2 years ago • 2 comments

Bug report

Hi, I have a ros node that publishes high res images and uses the loan api to do so. When I run the application everything works fine for between 1 to 2 hours. Then this function https://github.com/ros2/rmw_fastrtps/blob/galactic/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp#L160 starts to return RMW_RET_ERROR which in return throws an RCLError. The error RMW_RET_ERROR seems pretty generic and I am not sure what could be causing it. Could anyone give some insight into what might be causing this? Given that it works for the first few hours, I am pretty puzzled why it just stops being able to borrow a loaned message all of a sudden. Thanks in advance for any help.

System info

  • Operating System: Jetson agx, jetpack 4.6.1, ubuntu 18.04
  • Installation type: build from source inside docker container
  • Version or commit hash: galactic branch
  • DDS implementation: fastrtps
  • Client library (if applicable): rclcpp

Fastrtps xml profile

<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
    <profiles>
        <publisher profile_name="default publisher profile" is_default_profile="true">
            <qos>
                <publishMode>
                    <kind>SYNCHRONOUS</kind>
                </publishMode>
            </qos>
            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
        </publisher>

        <subscriber profile_name="default subscriber profile" is_default_profile="true">
            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
        </subscriber>

        <data_writer profile_name="/scenes">
            <topic>
                <name>/scenes</name>
            </topic>
            <qos>
                <data_sharing>
                    <kind>AUTOMATIC</kind>
                </data_sharing>
            </qos>
            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
        </data_writer>
        <data_reader profile_name="/scenes">
            <topic>
                <name>/scenes</name>
            </topic>
            <qos>
                <data_sharing>
                    <kind>AUTOMATIC</kind>
                </data_sharing>
            </qos>
            <historyMemoryPolicy>PREALLOCATED_WITH_REALLOC</historyMemoryPolicy>
        </data_reader>
    </profiles>
</dds>

benbarron avatar Jun 22 '22 02:06 benbarron

Update on this: after compiling with debug and using using gdb, I have found that DataWriter::loan_sample is returning ReturnCode_t::RETCODE_OUT_OF_RESOURCES. My assumption is that under certain circumstances DataWriter::discard_loan is not being called. Not sure if the is correct, or if so why it is occuring.

benbarron avatar Jun 22 '22 15:06 benbarron

Can you provide some detail of console output ?

llapx avatar Jun 29 '22 06:06 llapx