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

Fix IndexOutOfBoundsException in Strand Dump Tool and refactor logic #43707

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

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

codecov bot commented Dec 13, 2024

Codecov Report

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

Project coverage is 77.40%. Comparing base (0c56743) to head (5238115).
Report is 2 commits behind head on master.

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              @@
##             master   #43707      +/-   ##
============================================
- Coverage     77.40%   77.40%   -0.01%     
  Complexity    58600    58600              
============================================
  Files          3446     3446              
  Lines        219114   219116       +2     
  Branches      28965    28967       +2     
============================================
- Hits         169604   169597       -7     
- Misses        40080    40092      +12     
+ Partials       9430     9427       -3     

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

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