Skip to content

Prevent infinite recursion in hierarchy ownership updates#19

Merged
axeluhl merged 5 commits intoSAP:mainfrom
ishitadatta:fix-hierarchy-ownership-recursion
Mar 7, 2026
Merged

Prevent infinite recursion in hierarchy ownership updates#19
axeluhl merged 5 commits intoSAP:mainfrom
ishitadatta:fix-hierarchy-ownership-recursion

Conversation

@ishitadatta
Copy link
Copy Markdown
Contributor

Summary

This PR hardens ownership migration against cyclic event/leaderboard-group graphs that can otherwise recurse indefinitely.

What changed

  • Added visited-node guards in SailingHierarchyOwnershipUpdater for:
    • events
    • leaderboard groups
    • leaderboards
  • Added regression test testCyclicLeagueHierarchyOwnershipChangeStartingAtEventTerminates that builds a cyclic topology (shared leaderboard group across two events with an overall leaderboard) and verifies ownership update completes within a timeout.

Impact

This prevents non-terminating ownership updates and potential stack overflows in production when hierarchy links are cyclic, which is a high-severity reliability issue.

Validation

  • Added regression coverage in LeagueEventHierarchyOwnershipChangeTest.
  • Local test execution in this environment is blocked because no Java runtime is installed.

Signed-off-by: ishitadatta <isheeta50@gmail.com>
@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Mar 5, 2026

CLA assistant check
All committers have signed the CLA.

@axeluhl axeluhl self-assigned this Mar 6, 2026
@axeluhl axeluhl added the bug Something isn't working label Mar 6, 2026
@axeluhl
Copy link
Copy Markdown
Member

axeluhl commented Mar 6, 2026

Good catch, and nice work on the failing test case! :-)

Tracked at https://bugzilla.sapsailing.com/bugzilla/show_bug.cgi?id=6216

For the fix I suggest a few minor modifications. See https://github.com/SAP/sailing-analytics/tree/bug6216. A build is running at https://github.com/SAP/sailing-analytics/actions/runs/22759031743.

@axeluhl
Copy link
Copy Markdown
Member

axeluhl commented Mar 6, 2026

@ishitadatta can you please sign the CLA so we can include your proposed changes?

@axeluhl
Copy link
Copy Markdown
Member

axeluhl commented Mar 6, 2026

That test failure of OpenRegattaTest.simpleTest() seems to have been a stray Github Actions infrastructure issue. Locally, the test passes. I've triggered a re-run...

@axeluhl
Copy link
Copy Markdown
Member

axeluhl commented Mar 7, 2026

Merged branch bug6216 into main with 303cca9.

@axeluhl axeluhl closed this Mar 7, 2026
@axeluhl axeluhl reopened this Mar 7, 2026
@axeluhl axeluhl merged commit cdf9e61 into SAP:main Mar 7, 2026
3 of 6 checks passed
@axeluhl
Copy link
Copy Markdown
Member

axeluhl commented Mar 7, 2026

Thanks again, Ishita, for this contribution :-)

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants