Skip to content

Fix timeout for no metadata run session - #305

Merged
David-LP99 merged 8 commits into
rollingfrom
fix/wait
Sep 9, 2026
Merged

David-LP99 merged 8 commits into
rollingfrom
fix/wait

Conversation

@Acuadros95

Copy link
Copy Markdown
Contributor

Spin is not waiting if a session only haves timers, ending in a 100% CPU usage with code like this one: int32_publisher.

Also, we should run all sessions atleast once, to ensure a response to incoming data (From Hard liveliness check for example).

Related issue: #297

@Acuadros95
Acuadros95 requested a review from pablogs9 July 25, 2023 13:42
@github-actions

Copy link
Copy Markdown

Static memory analysis

Default configuration

MTU: 512 B
Input buffer size: 2048 B
Input history: 4
Output buffer size: 2048 B
Output history: 4

Entity Qty Size per unit
Context 2 5616 B
Topic 8 56 B
Service 4 248 B
Client 4 248 B
Subscription 4 280 B
Publisher 4 288 B
Node 4 208 B
Static input buffer 8 2136 B
Init options 6 64 B
Wait sets 4 56 B
Guard Condition 4 64 B

TOTAL: 34500 B

@Acuadros95

Copy link
Copy Markdown
Contributor Author

@mergify backport humble iron

@mergify

mergify Bot commented Jul 25, 2023

Copy link
Copy Markdown
Contributor

backport humble iron

🟠 Waiting for conditions to match

Details
  • merged [📌 backport requirement]

@Acuadros95 Acuadros95 changed the title Run session if any session is present Fix timeout for no metadata run session Jul 25, 2023

@fallenmi fallenmi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This review was prepared with OpenAI Codex assistance under the account owner's authorization.

The new blocking fallback runs before guard conditions are inspected. Guard conditions do not mark an XRCE context as need_to_be_ran, so a wait set containing an already-triggered guard enters this branch whenever a session exists. uxr_run_session_timeout() is then given the full per-session timeout, and hasTriggered is not checked until after that call returns. With an infinite RMW timeout, this can wait indefinitely for unrelated XRCE traffic. rmw_trigger_guard_condition() only sets the flag, so a guard raised while this fallback is blocked cannot interrupt it either.

I compiled the exact production rmw_wait.c from the PR merge-base, exact head, current rolling, and GitHub's synthetic current merge against a deterministic session/guard oracle. With one session, an already-triggered guard, and a 5-second wait:

  • merge-base 6833232797d1034860125e949f34067a850eeb43 and current rolling b6e02669d42fd5aeddc1e5b71bac65afd76cddf7 returned RMW_RET_OK after requesting a 0 ms session run;
  • exact head 52f23f9a342ca35006325691a3d6cfe05ff8345f and synthetic merge 1fce9ed4782d8c4892cb20d7e1f45cac37446061 still returned RMW_RET_OK, but only after requesting a 5000 ms session run.

The existing guard-condition test checks only the eventual return code, so it does not catch this latency regression. Please preserve immediate guard delivery when adding the timer-only blocking behavior, and add a timing/wakeup regression for both a pre-triggered guard and a guard triggered during the wait.

@mergify

mergify Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

backport humble iron

☑️ Command disallowed due to command restrictions in the Mergify configuration.

Details
  • sender-permission >= write

@mergify

mergify Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Signed-off-by: acuadros95 <acuadros1995@gmail.com>
Signed-off-by: acuadros95 <acuadros1995@gmail.com>
Signed-off-by: acuadros95 <acuadros1995@gmail.com>
@mergify

mergify Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.94%. Comparing base (96a1657) to head (f11fab6).

Additional details and impacted files
@@             Coverage Diff             @@
##           rolling     #305      +/-   ##
===========================================
+ Coverage    53.67%   54.94%   +1.26%     
===========================================
  Files          101      102       +1     
  Lines         5781     5917     +136     
  Branches       921      943      +22     
===========================================
+ Hits          3103     3251     +148     
+ Misses        2348     2330      -18     
- Partials       330      336       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@David-LP99
David-LP99 requested review from EugenioCollado and fallenmi and removed request for fallenmi September 8, 2026 14:30
@David-LP99
David-LP99 merged commit 938801c into rolling Sep 9, 2026
4 checks passed
@David-LP99
David-LP99 deleted the fix/wait branch September 9, 2026 11:28
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.

5 participants