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

Remove deprecated Query Server flags #2772

Merged
merged 9 commits into from
Feb 4, 2021

Conversation

rjs211
Copy link
Contributor

@rjs211 rjs211 commented Feb 3, 2021

Signed-off-by: rjs211 srivatsa211@gmail.com

Which problem is this PR solving?

Short description of the changes

  • The deprecated query.port and query.host-port were removed.
  • The redundant test cases were removed
  • Even though the behaviour remaiins the same, the code logic is simplified.

Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
@rjs211 rjs211 requested a review from a team as a code owner February 3, 2021 03:14
@mergify mergify bot requested a review from jpkrohling February 3, 2021 03:14
@rjs211
Copy link
Contributor Author

rjs211 commented Feb 3, 2021

The new logic is as follows:

  • If TLS in enabled in either or both of GRPC or HTTP endpoints, --query.http-server.host-portdefaults to :16686 and --query.grpc-server.host-port defaults to :16685
  • If TLS is disabled in both endpoints (default), both --query.http-server.host-port and --query.grpc-server.host-port default to :16686

This ensures that if the user doesn't specify the host-ports, the server would still initialize, for both TLS and non-TLS cases, conforming to the existing behaviour.

@yurishkuro yurishkuro changed the title Removing depricated Query Server flags Removing deprecated Query Server flags Feb 3, 2021
@codecov
Copy link

codecov bot commented Feb 3, 2021

Codecov Report

Merging #2772 (5421036) into master (9978f02) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2772      +/-   ##
==========================================
- Coverage   95.91%   95.89%   -0.02%     
==========================================
  Files         217      217              
  Lines        9634     9619      -15     
==========================================
- Hits         9240     9224      -16     
  Misses        326      326              
- Partials       68       69       +1     
Impacted Files Coverage Δ
cmd/query/app/flags.go 100.00% <ø> (ø)
cmd/query/app/server.go 97.08% <100.00%> (-0.05%) ⬇️
plugin/storage/badger/spanstore/reader.go 95.37% <0.00%> (-0.72%) ⬇️
plugin/storage/integration/integration.go 77.90% <0.00%> (+0.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9978f02...5421036. Read the comment docs.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Please add an entry to the changelog (and correct the previous one if applicable)

ports/ports.go Outdated
@@ -38,7 +38,8 @@ const (
// CollectorAdminHTTP is the default admin HTTP port (health check, metrics, etc.)
CollectorAdminHTTP = 14269

// QueryGRPC is the default port of GRPC requests for Query trace retrieval
// QueryGRPC is the default port of GRPC requests for Query trace retrieval when TLS is enabled.
// When TLS is disabled, QueryHTTP is used for both GRPC and HTTP endpoints
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// When TLS is disabled, QueryHTTP is used for both GRPC and HTTP endpoints
// When TLS is disabled and GRPC port not provided, QueryHTTP is used for both GRPC and HTTP endpoints

CHANGELOG.md Outdated
@@ -8,6 +8,8 @@ Changes by Version

#### Breaking Changes

* Remove deprecated flags of Query Server `--query.port` and `--query.host-port`, please use dedicated HTTP `--query.http-server.host-port` and GRPC `--query.grpc-server.host-port` host-ports flags instead ([#2772](https://github.com/jaegertracing/jaeger/pull/2772), [@rjs211](https://github.com/rjs211))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Remove deprecated flags of Query Server `--query.port` and `--query.host-port`, please use dedicated HTTP `--query.http-server.host-port` and GRPC `--query.grpc-server.host-port` host-ports flags instead ([#2772](https://github.com/jaegertracing/jaeger/pull/2772), [@rjs211](https://github.com/rjs211))
* Remove deprecated Query Server flags `--query.port` and `--query.host-port`, please use dedicated `--query.http-server.host-port` and `--query.grpc-server.host-port` flags ([#2772](https://github.com/jaegertracing/jaeger/pull/2772), [@rjs211](https://github.com/rjs211))

CHANGELOG.md Outdated

If TLS is disabled in both endpoints (default), dedicated host-ports are used if either or both of `--query.http-server.host-port` or `--query.grpc-server.host-port` is explicitly set. If only one of the dedicated host-port flags is set, the other flag uses its corresponding default value. If neither of the dedicated host-port flags are explicitly set, the common host-port infered from `--query.host-port` (defaults to `:16686`) is used for both the GRPC and HTTP endpoints.
* If TLS in enabled in either or both of GRPC or HTTP endpoints, `--query.http-server.host-port`defaults to `:16686` and `--query.grpc-server.host-port` defaults to `:16685`
* If TLS is disabled in both endpoints (default), both `--query.http-server.host-port` and `--query.grpc-server.host-port` default to `:16686`
Copy link
Member

Choose a reason for hiding this comment

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

I am a bit concerned that this will be confusing. Both new flags have default values (different ones), so the traditional behavior of the program when a flag is not specified explicitly is to use the default. However, here we're saying that even though the help command will show :16685 as default, the actual server is going to run on the shared :16686 port.

Perhaps we could just move this into breaking changes section and always treat the ports as separate, unless the same value is given in the config (which should only work for non-TLS).

@jpkrohling thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we could just move this into breaking changes section and always treat the ports as separate, unless the same value is given in the config (which should only work for non-TLS).

If we are breaking, then I'd force people to always use a different port. It makes the code easier to maintain, and I believe this is a good practice anyway...

Copy link
Member

Choose a reason for hiding this comment

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

I think that would be too "breaking". It's one thing to to change the flags, it's another to completely remove the ability to run on the same port. The same-port CMUX approach seems to work fine for non-TLS, I would rather keep it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good to me.

Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Signed-off-by: rjs211 <srivatsa211@gmail.com>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

THanks!

@yurishkuro yurishkuro merged commit 1e1d244 into jaegertracing:master Feb 4, 2021
@yurishkuro yurishkuro changed the title Removing deprecated Query Server flags Remove deprecated Query Server flags Feb 4, 2021
@yurishkuro yurishkuro mentioned this pull request Feb 4, 2021
7 tasks
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