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

[2201.11.0-stage] Refactor strand dump logic and fix bug #43713

Merged

Conversation

ravinperera00
Copy link
Contributor

Purpose

Occasionally, when trying to generate a strand dump report, the user runs into an IndexOutOfBoundsException. This PR intends to fix that issue and also refactor the code to improve readability and the scope of the stand dump report.

Approach

  • Fix
    When parsing the generated Java thread report, there can be cases where a virtual thread is present but its relevance to Ballerina cannot be established. Then, details about that thread won't be added to the list of Ballerina Strand details. Therefore, it is wrong to assume that the balStand array will have a 1:1 mapping for each id generated during the parsing resulting in an IndexOutOfBoundsException. This can be mitigated but using a Map with the id as the key instead of using an ArrayList.

  • Refactoring
    Broaden the scope of identifiers so that important ballerina related strands aren't missed.

Check List

  • Read the Contributing Guide
  • Updated Change Log
  • Checked Tooling Support (#)
  • Added necessary tests
    • Unit Tests
    • Spec Conformance Tests
    • Integration Tests
    • Ballerina By Example Tests
  • Increased Test Coverage
  • Added necessary documentation
    • API documentation
    • Module documentation in Module.md files
    • Ballerina By Examples

Copy link
Contributor

@warunalakshitha warunalakshitha left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 5 lines in your changes missing coverage. Please review.

Project coverage is 77.22%. Comparing base (f412009) to head (0060bf1).
Report is 43 commits behind head on 2201.11.0-stage.

Files with missing lines Patch % Lines
...rina/runtime/internal/troubleshoot/StrandDump.java 80.00% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##             2201.11.0-stage   #43713      +/-   ##
=====================================================
- Coverage              77.30%   77.22%   -0.09%     
- Complexity             58773    58790      +17     
=====================================================
  Files                   3525     3527       +2     
  Lines                 221434   221747     +313     
  Branches               28778    28813      +35     
=====================================================
+ Hits                  171189   171241      +52     
- Misses                 40597    40841     +244     
- Partials                9648     9665      +17     

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

@warunalakshitha warunalakshitha merged commit 9111ec1 into ballerina-platform:2201.11.0-stage Dec 19, 2024
18 of 19 checks passed
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