Skip to content

Entity Service and Config Service Configurable Timeouts #92

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

Merged
merged 5 commits into from
Jul 12, 2021

Conversation

suddendust
Copy link
Contributor

@suddendust suddendust commented Jul 11, 2021

Description

Like the PR here, this change is to make client timeout for the Attribute Service configurable.

Testing

Deployed and tested the application locally. Scenarios:

  1. Missing config: Default timeout is used.
  2. Timeout configured: Configured value is used.

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

@suddendust suddendust requested a review from a team as a code owner July 11, 2021 06:30
@codecov
Copy link

codecov bot commented Jul 11, 2021

Codecov Report

Merging #92 (d009bf9) into main (2cdb158) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #92      +/-   ##
============================================
- Coverage     22.26%   22.19%   -0.07%     
  Complexity       66       66              
============================================
  Files            64       64              
  Lines          1590     1595       +5     
  Branches         49       49              
============================================
  Hits            354      354              
- Misses         1229     1234       +5     
  Partials          7        7              
Flag Coverage Δ
unit 22.19% <0.00%> (-0.07%) ⬇️

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

Impacted Files Coverage Δ
...aphql/spaces/dao/ConfigServiceSpacesConfigDao.java 0.00% <0.00%> (ø)

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 2cdb158...d009bf9. Read the comment docs.

@suddendust
Copy link
Contributor Author

@aaron-steinfeld Same changes what we did for Gateway service. Please review once you're back. Thanks :)

@kotharironak
Copy link
Contributor

@suddendust Can you take care of snyk failure? If, not upgrade, can you update the .snyk file by extending the date?

@@ -22,16 +24,19 @@

private static final String ATTRIBUTE_SERVICE_HOST_PROPERTY = "attribute.service.host";
private static final String ATTRIBUTE_SERVICE_PORT_PROPERTY = "attribute.service.port";
private static final String ATTRIBUTE_SERVICE_PORT_TIMEOUT = "attribute.service.timeout";
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this ATTRIBUTE_SERVICE_PORT_TIMEOUT instead of ATTRIBUTE_SERVICE_CLIENT_TIMEOUT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typo, addressed.

this.configServiceTimeout =
getSuppliedDurationOrFallback(
() -> untypedConfig.getDuration(CONFIG_SERVICE_CLIENT_TIMEOUT));
this.entityServiceTimeout =
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this use anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

entityServiceTimeout is not being used anywhere. EntityTypeCachingClient uses a hardcoded value of 10s here. Should this value be replaced with this timeout?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was checking at the GQL level, if it is not used, should we add it or should we add it when it is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's a fair point. I just added it so that we have a consistent configuration (as all other services had a timeout). Should I remove it (we do have a default fallback value though so even if you don't give the config it'll work).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can keep it for consistency as we are going with the different services that might have a different timeout requirement, and already have fields for (host, port) for this one.

() -> untypedConfig.getDuration(ENTITY_SERVICE_CLIENT_TIMEOUT));
}

private Duration getSuppliedDurationOrFallback(Supplier<Duration> durationSupplier) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same nit about using optionallyGet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed. Thanks :)

Copy link
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.

Did you want to pull in the changes to the core submodule in this PR?

@suddendust
Copy link
Contributor Author

Did you want to pull in the changes to the core submodule in this PR?

Just did @aaron-steinfeld

Copy link
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.

Thanks @suddendust !

@aaron-steinfeld aaron-steinfeld merged commit 510a988 into hypertrace:main Jul 12, 2021
@github-actions
Copy link

Unit Test Results

10 files  ±0  10 suites  ±0   15s ⏱️ ±0s
20 tests ±0  20 ✔️ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 510a988. ± Comparison against base commit 2cdb158.

skjindal93 pushed a commit that referenced this pull request Jun 21, 2024
* refactor: attribute association expression rename

* fix: vulnerable dependency
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