Skip to content

[23523] Return sample notifying changes on instance state#5943

Merged
MiguelCompany merged 19 commits intomasterfrom
bugfix/22929
Jul 24, 2025
Merged

[23523] Return sample notifying changes on instance state#5943
MiguelCompany merged 19 commits intomasterfrom
bugfix/22929

Conversation

@MiguelCompany
Copy link
Member

@MiguelCompany MiguelCompany commented Jul 18, 2025

Description

Fixes a bug where changes in the instance state coming from internal events (unmatching, liveliness lost, deadline missed) were not notified with a fake sample (i.e. no data and info.valid_data equal false)

@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
  • 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.

@MiguelCompany MiguelCompany added this to the v3.3.1 milestone Jul 18, 2025
@github-actions github-actions bot added the ci-pending PR which CI is running label Jul 18, 2025
@MiguelCompany MiguelCompany removed the request for review from richiprosima July 18, 2025 10:26
@rsanchez15 rsanchez15 modified the milestones: v3.3.1, v3.4.0 Jul 18, 2025
@MiguelCompany MiguelCompany requested review from richiprosima and removed request for richiprosima July 18, 2025 20:09
@MiguelCompany MiguelCompany requested review from richiprosima and removed request for richiprosima July 21, 2025 06:10
@MiguelCompany MiguelCompany requested review from Mario-DL and richiprosima and removed request for richiprosima July 21, 2025 06:15
@MiguelCompany MiguelCompany requested review from richiprosima and removed request for richiprosima July 21, 2025 14:34
@MiguelCompany MiguelCompany force-pushed the bugfix/22929 branch 2 times, most recently from 224e7c0 to f17c90d Compare July 22, 2025 10:33
@MiguelCompany MiguelCompany requested review from Mario-DL and removed request for Mario-DL July 22, 2025 10:34
@MiguelCompany MiguelCompany requested review from Mario-DL and removed request for Mario-DL July 22, 2025 12:46
Copy link
Contributor

@Mario-DL Mario-DL left a comment

Choose a reason for hiding this comment

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

Nice maneuver to notify the final state on an instance with no writers. Leaving some minor suggestions.
We would need to relaunch or review the failed asan test report

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Mario-DL
Mario-DL previously approved these changes Jul 23, 2025
Copy link
Contributor

@Mario-DL Mario-DL 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 green CI

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Copy link
Contributor

@Mario-DL Mario-DL 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 green CI

@MiguelCompany MiguelCompany merged commit 16b7477 into master Jul 24, 2025
52 of 55 checks passed
@MiguelCompany MiguelCompany deleted the bugfix/22929 branch July 24, 2025 15:02
@MiguelCompany
Copy link
Member Author

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

@mergify
Copy link
Contributor

mergify bot commented Jul 24, 2025

backport 3.3.x 3.2.x 2.14.x

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Jul 24, 2025
* Refs #22929. Add regression blackbox test.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Improve test with listener.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Manage state of `has_fake_sample`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid removing instances with fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add instances with fake sample to `data_available_instances_`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add fake sample independently of remaining samples

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Notify data_available when adding a fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Remove shortcut for returning NO_DATA.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in PubSubReader.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix DataReaderTests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix Latency tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Rename `fake` into `state notification`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use HANDLE_NIL for publication handle.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use NIL publication handle to discard samples in tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use scoped name for HANDLE_NIL.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 16b7477)
mergify bot pushed a commit that referenced this pull request Jul 24, 2025
* Refs #22929. Add regression blackbox test.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Improve test with listener.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Manage state of `has_fake_sample`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid removing instances with fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add instances with fake sample to `data_available_instances_`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add fake sample independently of remaining samples

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Notify data_available when adding a fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Remove shortcut for returning NO_DATA.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in PubSubReader.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix DataReaderTests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix Latency tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Rename `fake` into `state notification`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use HANDLE_NIL for publication handle.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use NIL publication handle to discard samples in tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use scoped name for HANDLE_NIL.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 16b7477)
mergify bot pushed a commit that referenced this pull request Jul 24, 2025
* Refs #22929. Add regression blackbox test.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Improve test with listener.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Manage state of `has_fake_sample`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid removing instances with fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add instances with fake sample to `data_available_instances_`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add fake sample independently of remaining samples

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Notify data_available when adding a fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Remove shortcut for returning NO_DATA.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in PubSubReader.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix DataReaderTests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix Latency tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Rename `fake` into `state notification`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use HANDLE_NIL for publication handle.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use NIL publication handle to discard samples in tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use scoped name for HANDLE_NIL.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 16b7477)

# Conflicts:
#	src/cpp/fastdds/subscriber/DataReaderImpl.cpp
#	src/cpp/fastdds/subscriber/history/DataReaderHistory.hpp
#	test/blackbox/api/dds-pim/PubSubReader.hpp
#	test/blackbox/common/DDSBlackboxTestsMonitorService.cpp
#	test/performance/latency/LatencyTestPublisher.cpp
#	test/performance/latency/LatencyTestSubscriber.cpp
MiguelCompany added a commit that referenced this pull request Jul 29, 2025
* Refs #22929. Add regression blackbox test.



* Refs #22929. Improve test with listener.



* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.



* Refs #22929. Manage state of `has_fake_sample`.



* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.



* Refs #22929. Avoid removing instances with fake sample.



* Refs #22929. Add instances with fake sample to `data_available_instances_`.



* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.



* Refs #22929. Add fake sample independently of remaining samples



* Refs #22929. Notify data_available when adding a fake sample.



* Refs #22929. Remove shortcut for returning NO_DATA.



* Refs #22929. Avoid processing fake samples in PubSubReader.



* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.



* Refs #22929. Fix DataReaderTests.



* Refs #22929. Fix Latency tests.



* Refs #22929. Rename `fake` into `state notification`.



* Refs #22929. Use HANDLE_NIL for publication handle.



* Refs #22929. Use NIL publication handle to discard samples in tests.



* Refs #22929. Use scoped name for HANDLE_NIL.



---------


(cherry picked from commit 16b7477)

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jul 29, 2025
* Refs #22929. Add regression blackbox test.



* Refs #22929. Improve test with listener.



* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.



* Refs #22929. Manage state of `has_fake_sample`.



* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.



* Refs #22929. Avoid removing instances with fake sample.



* Refs #22929. Add instances with fake sample to `data_available_instances_`.



* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.



* Refs #22929. Add fake sample independently of remaining samples



* Refs #22929. Notify data_available when adding a fake sample.



* Refs #22929. Remove shortcut for returning NO_DATA.



* Refs #22929. Avoid processing fake samples in PubSubReader.



* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.



* Refs #22929. Fix DataReaderTests.



* Refs #22929. Fix Latency tests.



* Refs #22929. Rename `fake` into `state notification`.



* Refs #22929. Use HANDLE_NIL for publication handle.



* Refs #22929. Use NIL publication handle to discard samples in tests.



* Refs #22929. Use scoped name for HANDLE_NIL.



---------


(cherry picked from commit 16b7477)

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jul 29, 2025
* Refs #22929. Add regression blackbox test.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Improve test with listener.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Manage state of `has_fake_sample`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid removing instances with fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add instances with fake sample to `data_available_instances_`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add fake sample independently of remaining samples

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Notify data_available when adding a fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Remove shortcut for returning NO_DATA.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in PubSubReader.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix DataReaderTests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix Latency tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Rename `fake` into `state notification`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use HANDLE_NIL for publication handle.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use NIL publication handle to discard samples in tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use scoped name for HANDLE_NIL.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jul 29, 2025
* Refs #22929. Add regression blackbox test.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Improve test with listener.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Manage state of `has_fake_sample`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid removing instances with fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add instances with fake sample to `data_available_instances_`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Add fake sample independently of remaining samples

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Notify data_available when adding a fake sample.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Remove shortcut for returning NO_DATA.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in PubSubReader.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix DataReaderTests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Fix Latency tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Rename `fake` into `state notification`.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use HANDLE_NIL for publication handle.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use NIL publication handle to discard samples in tests.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #22929. Use scoped name for HANDLE_NIL.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany added a commit that referenced this pull request Jul 30, 2025
* Refs #22929. Add regression blackbox test.



* Refs #22929. Improve test with listener.



* Refs #22929. Add `has_fake_sample` to `DataReaderInstance`.



* Refs #22929. Manage state of `has_fake_sample`.



* Refs #22929. Handle `has_fake_sample` on `ReadTakeCommand`.



* Refs #22929. Avoid removing instances with fake sample.



* Refs #22929. Add instances with fake sample to `data_available_instances_`.



* Refs #22929. Method `writer_not_alive` returns whether a fake sample was added.



* Refs #22929. Add fake sample independently of remaining samples



* Refs #22929. Notify data_available when adding a fake sample.



* Refs #22929. Remove shortcut for returning NO_DATA.



* Refs #22929. Avoid processing fake samples in PubSubReader.



* Refs #22929. Avoid processing fake samples in DDSBlackboxTestsMonitorService.



* Refs #22929. Fix DataReaderTests.



* Refs #22929. Fix Latency tests.



* Refs #22929. Rename `fake` into `state notification`.



* Refs #22929. Use HANDLE_NIL for publication handle.



* Refs #22929. Use NIL publication handle to discard samples in tests.



* Refs #22929. Use scoped name for HANDLE_NIL.



---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
Blast545 added a commit to Blast545/Fast-DDS that referenced this pull request Jul 31, 2025
Blast545 added a commit to Blast545/Fast-DDS that referenced this pull request Aug 1, 2025
) (eProsima#5956)"

This reverts commit 0b18cfe.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
MiguelCompany pushed a commit that referenced this pull request Aug 1, 2025
…5968)

This reverts commit 0b18cfe.

Signed-off-by: Jorge J. Perez <jjperez@ekumenlabs.com>
MiguelCompany added a commit that referenced this pull request Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-pending PR which CI is running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants