Fix Reflections stack traces when process yml files in classpath and …#12991
Merged
andsel merged 2 commits intoelastic:masterfrom Jun 16, 2021
Merged
Conversation
…debug log is enabled
9 tasks
kaisecheng
approved these changes
Jun 16, 2021
Contributor
kaisecheng
left a comment
There was a problem hiding this comment.
I have tested locally and confirmed the ReflectionsException exception has gone. A suggestion for the comment, otherwise LGTM. Thanks for the quick fix.
| // the constructor of Reflection must be called only by one thread, else there is a | ||
| // risk that the first thread that completes close the Zip files for the others. | ||
| Reflections reflections = new Reflections("org.logstash.plugins"); | ||
| // filter from processing all resources present in package classpath that are not classes. |
Contributor
There was a problem hiding this comment.
suggestion
// scan all .class present in package classpath
andsel
added a commit
to andsel/logstash
that referenced
this pull request
Jun 18, 2021
…debug is enabled (elastic#12991) Adds a filter to Reflections library initialization so that when it scan "org.logstash.plugins" it includes only .class files and avoid to load and process AliasRegistry.yml and plugin_aliases.yml Fixes elastic#12992 (cherry picked from commit a6e9a6b)
kares
added a commit
to kares/logstash
that referenced
this pull request
Jul 1, 2021
* master: (41 commits) Test: resolve integration failure due ECS mode (elastic#13044) Feat: event factory support (elastic#13017) Doc: Add geoip database API to node stats (elastic#13019) Add geoip database metrics to /node/stats API (elastic#13004) ecs: on-by-default plus docs (elastic#12830) ispec: fix cross-spec leak from fatal error integration specs (elastic#13002) Fix UBI source URL (elastic#13008) update fpm to allow pkg creation on jdk11+jruby 9.2 (elastic#13005) Add unit test to grant that production aliases correspond to a published RubyGem (elastic#12993) Fix logstash.bat not setting exit code (elastic#12948) Use the OS separator to invoke gradlew from Rake script (elastic#13000) Allow per-pipeline config of ECS Compatibility mode via Central Management (elastic#12861) Update jinja2 dependency in docker build (elastic#12994) fix database manager with multiple pipelines (elastic#12862) Fix Reflections stack traces when process yml files in classpath and debug is enabled (elastic#12991) Fix/log4j routing to avoid create spurious file (elastic#12965) Deps: update JRuby to 9.2.19.0 (elastic#12989) Doc: Add tip for checking for existing field (elastic#12899) Added test to cover the installation of aliased plugins (elastic#12967) CI: Update logstash_release.json after 7.3.12 (elastic#12986) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release notes
[rn:skip]
What does this PR do?
Adds a filter to Reflections library when it scan
org.logstash.pluginsto include only.classfiles and avoid to load and process AliasRegistry.yml and plugin_aliases.yml. Fixes #12992Why is it important/What is the impact to the user?
Avoid to see stacktrace error when Logstash is run in debug
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration files (and/or docker env variables)I have added tests that prove my fix is effective or that my feature worksAuthor's Checklist
How to test this PR locally
Run Logstash with
bin/logstash -e "input {stdin{}} output{stdout{ codec => rubydebug}}" --log.level debugand check no stacktraces are present in console.Related issues
Use cases
Screenshots
Logs