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

[core] Restore behavior with thread=1 setting #4550

Merged
merged 4 commits into from
May 22, 2023

Conversation

adangel
Copy link
Member

@adangel adangel commented May 5, 2023

Describe the PR

Found this while upgrading the manual integration tests (see pmd/pmd-regression-tester#119): The errors where different when comparing to the baseline - but only the stacktrace. I could see, that the stacktraces are either from the main thread (including PmdCli) or from a worker thread (then they are shorter).
As we didn't specify the thread count for the regression tester baseline, it should be the default, which is "1" - and that should actually run the MultiThreadProcessor. Only with thread count=0 we should use MonoThreadProcessor. See the CLI documentation on threads:

Sets the number of threads used by PMD. Set threads to 0 to disable multi-threading processing.

Keeping to this behavior, it should make the error stacktraces more comparable regardless whether you run it with 4 threads or only with 1.
See also the old impl:

return configuration.getThreads() > 0 ? new MultiThreadProcessor(configuration)

Additionally, I took the chance to set the threads now when creating the baseline or running regression tester. Maybe it makes it a bit faster (don't know, how powerful the GitHub action instance runners are).

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@adangel adangel added this to the 7.0.0 milestone May 5, 2023
@pmd-test
Copy link

pmd-test commented May 5, 2023

1 Message
📖 Compared to master:
This changeset changes 11 violations,
introduces 1 new violations, 1 new errors and 0 new configuration errors,
removes 297 violations, 0 errors and 0 configuration errors.
Full report

Generated by 🚫 Danger

@jsotuyod jsotuyod merged commit bcf8bdd into pmd:master May 22, 2023
3 checks passed
@adangel adangel deleted the pmd-processor-threads branch May 26, 2023 08:31
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.

None yet

3 participants