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

Added missing method of logger wrapper for puma #15640

Merged
merged 1 commit into from Nov 30, 2023

Conversation

kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Nov 30, 2023

Release notes

Fix node stats API when the API path is invalid

What does this PR do?

The PR adds the missing method debug? in DelegatingLogWriter

Puma uses stderr to log error. DelegatingLogWriter takes IOWrappedLogger as stderr and IOWrappedLogger takes DelegatingLogWriter as logger. IOWrappedLogger checks logger level here.

Why is it important/What is the impact to the user?

The change allow node state to return meaningful error message

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I 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 works

Author's Checklist

  • [ ]

How to test this PR locally

Run this branch and curl -XGET 'localhost:9600/_node/stats/invalid_path'. The response should not throw exception.

Related issues

Use cases

Screenshots

Logs

This commit fixes no method error when node stats API got
invalid path, which triggers puma to print error using stderr

Fix: elastic#15639
@kaisecheng kaisecheng self-assigned this Nov 30, 2023
Copy link

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @kaisecheng

Copy link
Contributor

@edmocosta edmocosta left a comment

Choose a reason for hiding this comment

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

LGTM!

@kaisecheng kaisecheng merged commit 05392ad into elastic:main Nov 30, 2023
5 checks passed
@kaisecheng
Copy link
Contributor Author

@logstashmachine backport 8.11

github-actions bot pushed a commit that referenced this pull request Nov 30, 2023
This commit fixes no method error when node stats API got
invalid API path, which triggers puma to print error using stderr

Fix: #15639
(cherry picked from commit 05392ad)
kaisecheng added a commit that referenced this pull request Nov 30, 2023
This commit fixes no method error when node stats API got
invalid API path, which triggers puma to print error using stderr

Fix: #15639
(cherry picked from commit 05392ad)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node stats API raise error when the path is invalid
3 participants