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 IllegalArgumentException in Replayer logging #632

Conversation

AndreKurait
Copy link
Member

@AndreKurait AndreKurait commented May 3, 2024

Description

This change fixes illegal argument exception in a few places where the replayer logs messages contain "{}".

  • Category: Enhancement/Bug Fix
  • Why these changes are required? Reduce log injection attacks and log formatting exceptions
  • What is the old behavior before changes and new behavior after changes? Before this change, some logs contained errors around missing arguments. Now that is removed

Issues Resolved

Progress towards Bug #633

Is this a backport? If so, please add backport PR # and/or commits #

Testing

Ran some end to end testing locally with various log levels and checking for errors.

Check List

  • [ x] New functionality includes testing
    • [ x] All tests pass, including unit test, integration test and doctest
  • [ x] New functionality has been documented
  • [ x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@AndreKurait AndreKurait force-pushed the LoggingArgumentOverConcatenation branch from 2690924 to 6b88953 Compare May 6, 2024 15:47
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 10 lines in your changes are missing coverage. Please review.

Project coverage is 75.80%. Comparing base (7b270fa) to head (2e9e5ee).
Report is 18 commits behind head on main.

Files Patch % Lines
...earch/migrations/replay/ResultsToLogsConsumer.java 30.76% 8 Missing and 1 partial ⚠️
...h/migrations/replay/util/ActiveContextMonitor.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main     #632   +/-   ##
=========================================
  Coverage     75.79%   75.80%           
- Complexity     1543     1548    +5     
=========================================
  Files           168      168           
  Lines          6437     6455   +18     
  Branches        575      575           
=========================================
+ Hits           4879     4893   +14     
- Misses         1179     1184    +5     
+ Partials        379      378    -1     
Flag Coverage Δ
unittests 75.80% <60.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@AndreKurait AndreKurait force-pushed the LoggingArgumentOverConcatenation branch from 6b88953 to 9ca9f29 Compare May 6, 2024 16:09
@AndreKurait AndreKurait changed the title Update replayer log messages to use SLF4J fluent syntax Fix IllegalArgumentException in Replayer logging May 6, 2024
@peternied
Copy link
Member

@AndreKurait Could you look into the CI failures before merging?

@@ -72,7 +72,7 @@ appender.ALL_ACTIVE_WORK_MONITOR_LOGFILE.strategy.type = DefaultRolloverStrategy
appender.ALL_ACTIVE_WORK_MONITOR_LOGFILE.strategy.max = 4
appender.ALL_ACTIVE_WORK_MONITOR_LOGFILE.immediateFlush = false

rootLogger.level = info
rootLogger.level = trace
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't do this!

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed, thanks

@AndreKurait AndreKurait merged commit 8ae3960 into opensearch-project:main May 9, 2024
6 of 7 checks passed
@AndreKurait AndreKurait deleted the LoggingArgumentOverConcatenation branch May 9, 2024 18: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.

3 participants