Skip to content

Conversation

zesk1999
Copy link
Contributor

@zesk1999 zesk1999 commented Sep 8, 2025

Description

This PR fixes an issue where a DataWriter with a deadline period of 0ms would cause a high CPU load due to an infinite loop of deadline_missed callbacks.

The DataWriterImpl has been modified to handle a 0 as a special case. When this condition is detected:

  • A single warning is logged.
  • The deadline_missed_status_.total_count and deadline_missed_status_.total_count_change are set to INT_MAX as a sentinel value.

This ensures that the DataWriter remains stable and responsive, and allows the deadline timer to be properly re-armed if the QoS is later changed to a valid value.
Also, reaching the maximal number of deadline missed messages cancels the timer.

Fixes #23289

@Mergifyio backport 3.3.x 3.2.x 2.14.x

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • [N/A] Any new/modified methods have been properly documented using Doxygen.
  • [N/A] Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
  • Changes are backport compatible: they do NOT break ABI nor change library core behavior.
  • Changes are API compatible.
  • [N/A] New feature has been added to the versions.md file (if applicable).
  • [N/A] New feature has been documented/Current behavior is correctly described in the documentation.
  • Applicable backports have been included in the description.

Reviewer Checklist

  • The PR has a milestone assigned.
  • The title and description correctly express the PR's purpose.
  • Check contributor checklist is correct.
  • If this is a critical bug fix, backports to the critical-only supported branches have been requested.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@zesk1999 zesk1999 changed the title Hotfix/23289: deadline timer fixes Hotfix/23289: deadline 0 timer fix not to call deadline missed Sep 11, 2025
@zesk1999 zesk1999 marked this pull request as ready for review September 13, 2025 09:50
Copy link
Contributor

@juanlofer-eprosima juanlofer-eprosima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Here are a couple of suggestions:

  • Apply same fixes to DataReader
  • Make the PR directly from this repo (instead of your fork). Take this into account for the next time, let's keep this PR as it is.
  • Reorganize commits
  • Bonus: handle 0 lifespan case

@juanlofer-eprosima juanlofer-eprosima changed the title Hotfix/23289: deadline 0 timer fix not to call deadline missed [23289] Handle maximum deadline misses case Sep 15, 2025
@juanlofer-eprosima juanlofer-eprosima added this to the v3.4.0 milestone Sep 15, 2025
Copy link
Contributor Author

@zesk1999 zesk1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestions are applied.

Copy link
Contributor

@juanlofer-eprosima juanlofer-eprosima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to apply the same fixes to the reader before merging.

@zesk1999 zesk1999 force-pushed the hotfix/23289 branch 4 times, most recently from c7b1a94 to 6602485 Compare September 26, 2025 17:42
Copy link
Contributor

mergify bot commented Sep 27, 2025

🧪 CI Insights

Here's what we observed from your CI run for bc00597.

❌ Job Failures

Pipeline Job Health on master Retries 🔍 CI Insights 📄 Logs
Fast DDS Linters CI uncrustify Unknown 0 View View
Fast DDS MacOS CI mac-ci / fastdds_test () Unknown 0 View View
Fast DDS Windows CI windows-ci / fastdds_test (RelWithDebInfo, examples), v143 Unknown 0 View View

@zesk1999 zesk1999 force-pushed the hotfix/23289 branch 2 times, most recently from a6a5764 to ab5f1e7 Compare September 30, 2025 09:32
@zesk1999 zesk1999 removed the request for review from juanlofer-eprosima September 30, 2025 09:42
@zesk1999 zesk1999 requested review from juanlofer-eprosima and removed request for juanlofer-eprosima September 30, 2025 18:28
@MiguelCompany MiguelCompany modified the milestones: v3.4.0, v3.4.1 Oct 3, 2025
@zesk1999 zesk1999 force-pushed the hotfix/23289 branch 2 times, most recently from 2208044 to 09aa16d Compare October 9, 2025 10:08
Copy link
Contributor

@juanlofer-eprosima juanlofer-eprosima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with greenish CI

@juanlofer-eprosima juanlofer-eprosima requested review from richiprosima and removed request for richiprosima October 9, 2025 10:39
@juanlofer-eprosima juanlofer-eprosima merged commit 3230d1d into eProsima:master Oct 10, 2025
25 of 28 checks passed
@juanlofer-eprosima
Copy link
Contributor

https://github.com/Mergifyio backport 3.3.x 3.2.x 2.14.x

Copy link
Contributor

mergify bot commented Oct 10, 2025

backport 3.3.x 3.2.x 2.14.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 10, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	test/blackbox/CMakeLists.txt
mergify bot pushed a commit that referenced this pull request Oct 10, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
mergify bot pushed a commit that referenced this pull request Oct 10, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
zesk1999 added a commit that referenced this pull request Oct 13, 2025
zesk1999 added a commit that referenced this pull request Oct 14, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
juanlofer-eprosima pushed a commit that referenced this pull request Oct 14, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
juanlofer-eprosima pushed a commit that referenced this pull request Oct 14, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
zesk1999 added a commit that referenced this pull request Oct 14, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
juanlofer-eprosima pushed a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
zesk1999 added a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
zesk1999 added a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
zesk1999 added a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
juanlofer-eprosima pushed a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt

Co-authored-by: Zeljko Jovanovic <[email protected]>
zesk1999 added a commit that referenced this pull request Oct 15, 2025
* Refs #23289. Handle maximum deadline misses case. Data writer implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Data reader implementation.

Signed-off-by: zesk1999 <[email protected]>

* Refs #23289. Handle maximum deadline misses case. Tests.

Signed-off-by: zesk1999 <[email protected]>

---------

Signed-off-by: zesk1999 <[email protected]>
(cherry picked from commit 3230d1d)
Signed-off-by: zesk1999 <[email protected]>

# Conflicts:
#	src/cpp/fastdds/publisher/DataWriterImpl.cpp
#	src/cpp/fastdds/publisher/DataWriterImpl.hpp
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	test/blackbox/CMakeLists.txt
#	test/blackbox/common/BlackboxTestsDeadlineQos.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants