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

[KYUUBI #6615] Make Jetty sending server version in response configurable #6685

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paul8263
Copy link
Contributor

@paul8263 paul8263 commented Sep 11, 2024

🔍 Description

Issue References 🔗

This pull request fixes #6615

Describe Your Solution 🔧

Add a config item that controls whether Jetty should send its version in response.

This is an additional patch which enables/disables sending Jetty version for prometheus reporter.

Sending Jetty version could be disabled by calling HttpConfiguration::setSendServerVersion(false)

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Compiled and tested manually.

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklist 📝

Be nice. Be informative.

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (edbe3f3) to head (0638a51).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...che/kyuubi/metrics/PrometheusReporterService.scala 0.00% 11 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #6685   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         684     684           
  Lines       42237   42247   +10     
  Branches     5755    5755           
======================================
- Misses      42237   42247   +10     

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

@cxzl25 cxzl25 changed the title [KYUUBI #6615] Make Jetty sending server version in response configur… [KYUUBI #6615] Make Jetty sending server version in response configurable Sep 11, 2024
@volatile protected var isStarted = false

override def initialize(conf: KyuubiConf): Unit = {
val port = conf.get(MetricsConf.METRICS_PROMETHEUS_PORT)
val contextPath = conf.get(MetricsConf.METRICS_PROMETHEUS_PATH)
httpServer = new Server(port)
val sendServerVersion = conf.get(FRONTEND_JETTY_SEND_VERSION_ENABLED)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
val sendServerVersion = conf.get(FRONTEND_JETTY_SEND_VERSION_ENABLED)
val jettyVersionEnabled = conf.get(FRONTEND_JETTY_SEND_VERSION_ENABLED)

@@ -35,12 +36,21 @@ class PrometheusReporterService(registry: MetricRegistry)

// VisibleForTesting
private[metrics] var httpServer: Server = _
private[metrics] var connector: ServerConnector = _
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private[metrics] var connector: ServerConnector = _
private[metrics] var httpServerConnector: ServerConnector = _

To follow the naming conversion with existed httpServer variable.

Comment on lines 92 to 93
httpServer.stop()
connector.stop()
Copy link
Contributor

Choose a reason for hiding this comment

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

Whether we should stop the server connector before the stopping the server?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @bowenliang123 ,
Thanks for the review.
I refered to the codes in JettyServer, in which the stop method closes the server first and then the server conenctor. I think it should work as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants