Skip to content

Gateway-Service Client Timeout Config#70

Merged
aaron-steinfeld merged 3 commits intohypertrace:mainfrom
suddendust:gateway_client_deadline_config
Jul 9, 2021
Merged

Gateway-Service Client Timeout Config#70
aaron-steinfeld merged 3 commits intohypertrace:mainfrom
suddendust:gateway_client_deadline_config

Conversation

@suddendust
Copy link
Copy Markdown
Contributor

Description

These changes are in context of: #69. Currently, we hardcode the deadline as 10s. Now, GATEWAY_SERVICE_DEADLINE is read from application.conf

Testing

Deployed and tested the application manually. I am still seeing if I can write a UT for check if config value is being loaded properly.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

These changes are dependent on: hypertrace/hypertrace-service#99

@suddendust suddendust requested a review from a team as a code owner July 9, 2021 17:02
Copy link
Copy Markdown
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

also, please add the default value to application.conf (as a duration, can be specified like 10s https://github.com/lightbend/config/blob/main/HOCON.md#duration-format

@aaron-steinfeld
Copy link
Copy Markdown
Contributor

Also, welcome and thanks for the contribution!


private static final String GATEWAY_SERVICE_HOST_PROPERTY = "gateway.service.host";
private static final String GATEWAY_SERVICE_PORT_PROPERTY = "gateway.service.port";
private static final String GATEWAY_SERVICE_RPC_CLIENT_DEADLINE = "gateway.service.deadline";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need to keep it as a mandatory field? Can we take the value from config if it is defined or take the default value?

Copy link
Copy Markdown
Contributor

@aaron-steinfeld aaron-steinfeld Jul 9, 2021

Choose a reason for hiding this comment

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

we do want a default, it's just a matter of where to set the default - defining it both in code and in config just makes it a bit more opaque to follow since it's an extra layer of resolution, and the config reading has to then handle the unset case.

Usually, we set defaults in application.conf, and that's optionally overriden via helm (or env vars if run via docker)

@suddendust suddendust changed the title Added config for gateway gRPC client deadline Gateway-Service Client Timeout Config Jul 9, 2021
Copy link
Copy Markdown
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

the snyk verification is failing due to some outdated dependencies - we can handle that separately, fine for this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 9, 2021

Codecov Report

Merging #70 (5ced14a) into main (5d48c7b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##               main      #70   +/-   ##
=========================================
  Coverage     59.30%   59.30%           
  Complexity      239      239           
=========================================
  Files            79       79           
  Lines          1209     1209           
  Branches         34       34           
=========================================
  Hits            717      717           
  Misses          464      464           
  Partials         28       28           
Flag Coverage Δ
unit 59.30% <ø> (ø)

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


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 5d48c7b...5ced14a. Read the comment docs.

@aaron-steinfeld aaron-steinfeld merged commit 2b889a0 into hypertrace:main Jul 9, 2021
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 9, 2021

Unit Test Results

29 files  ±0  29 suites  ±0   24s ⏱️ +2s
94 tests ±0  94 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 2b889a0. ± Comparison against base commit 5d48c7b.

@suddendust
Copy link
Copy Markdown
Contributor Author

Thanks @aaron-steinfeld for the quick reviews, really appreciate it.

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