-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@aaron-steinfeld Same changes what we did for Gateway service. Please review once you're back. Thanks :) |
@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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this use anywhere?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed. Thanks :)
There was a problem hiding this 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?
Just did @aaron-steinfeld |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @suddendust !
* refactor: attribute association expression rename * fix: vulnerable dependency
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:
Checklist: