Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename "deadlock" to "stall" in LoadManager #5341

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Bronek
Copy link
Collaborator

@Bronek Bronek commented Mar 10, 2025

High Level Overview of Change

In the condition of severe CPU starvation, LoadManager will intentionally crash rippled reporting LogicError: Deadlock detected. This error message is misleading; the condition being detected is not a deadlock. Let's change the name accordingly.

Context of Change

In the context of multithreaded programs, 'deadlock' has a specific meaning and what the LoadManager class does, has nothing to do with it. At the time when this class was originally written, std::mutex etc. primitives were unable to report actual deadlocks, so this class LoadManager was used instead to detect a lack of progress in JobQueue.

Since then we have better tools, and the only thing this class is left doing is stall detection, which is not the same as deadlock detection.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

In the context of multithreaded programs, 'deadlock' has a specific
meaning and what the LoadManager class does, has nothing to do with it.
At the time when this class was originally written, std::mutex etc.
primitives were unable to report actual deadlocks, so this class
LoadManager was used instead to detect a lack of progress in JobQueue.

Since then we have better tools, and the only thing this class is left
doing is stall detection, which is not the same as deadlock detection.

Let's change the names and error messages correspondingly.
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 28.00000% with 18 lines in your changes missing coverage. Please review.

Project coverage is 78.1%. Comparing base (2216e5a) to head (0059871).

Files with missing lines Patch % Lines
src/xrpld/app/main/LoadManager.cpp 30.4% 16 Missing ⚠️
src/xrpld/app/main/Application.cpp 0.0% 1 Missing ⚠️
src/xrpld/app/misc/NetworkOPs.cpp 0.0% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #5341     +/-   ##
=========================================
- Coverage     78.1%   78.1%   -0.0%     
=========================================
  Files          790     790             
  Lines        67908   67910      +2     
  Branches      8230    8229      -1     
=========================================
- Hits         53034   53025      -9     
- Misses       14874   14885     +11     
Files with missing lines Coverage Δ
src/xrpld/app/main/Application.cpp 69.3% <0.0%> (ø)
src/xrpld/app/misc/NetworkOPs.cpp 69.1% <0.0%> (ø)
src/xrpld/app/main/LoadManager.cpp 56.4% <30.4%> (-0.2%) ⬇️

... and 3 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Vlad <129996061+vvysokikh1@users.noreply.github.com>
@Bronek Bronek force-pushed the Bronek/rename_deadlock_to_stall branch from c604474 to 0059871 Compare March 10, 2025 12:23
@Bronek Bronek requested a review from vvysokikh1 March 10, 2025 12:24
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.

2 participants