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

refactor: add support for client timeouts #217

Merged
merged 3 commits into from
Jun 7, 2024
Merged

Conversation

aaron-steinfeld
Copy link
Contributor

Description

This change adds support for client timeouts on all config store abstractions, using a default of 5s if unset.

@aaron-steinfeld aaron-steinfeld requested a review from a team as a code owner June 7, 2024 12:43
Copy link

github-actions bot commented Jun 7, 2024

Test Results

121 tests  ±0   121 ✅ ±0   1m 2s ⏱️ ±0s
 29 suites ±0     0 💤 ±0 
 29 files   ±0     0 ❌ ±0 

Results for commit 97ce440. ± Comparison against base commit 246d22e.

♻️ This comment has been updated with latest results.

public class ClientConfig {
Duration timeout;

public static ClientConfig DEFAULT = new ClientConfig(Duration.ofSeconds(5));

Choose a reason for hiding this comment

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

Default looks good,
max for this as observed in past is <5s

Choose a reason for hiding this comment

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

nit: we can add a TODO here to read this value POJO from config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because this is used by so many different services, I don't love providing it from config - since that means the config itself is needed to build the abstract store object which means every service now needs to get access to it and pass it in. The override case certainly could be from config, but let me think through how/if we could accomplish this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a todo, and moved the default up to 10s to make sure we're safe (since the intention here is to be as compatible with existing behavior as possible we don't even want to approach the 5s limit)

tim-mwangi
tim-mwangi previously approved these changes Jun 7, 2024
Copy link

codecov bot commented Jun 7, 2024

Codecov Report

Attention: Patch coverage is 94.04762% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.02%. Comparing base (49d70b0) to head (97ce440).
Report is 10 commits behind head on main.

Files Patch % Lines
...g/objectstore/IdentifiedObjectStoreWithFilter.java 0.00% 2 Missing ⚠️
...rg/hypertrace/config/objectstore/ClientConfig.java 66.66% 1 Missing ⚠️
...ertrace/config/objectstore/DefaultObjectStore.java 96.29% 1 Missing ⚠️
...race/config/objectstore/IdentifiedObjectStore.java 97.56% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #217      +/-   ##
============================================
+ Coverage     79.92%   80.02%   +0.09%     
- Complexity      488      496       +8     
============================================
  Files            54       55       +1     
  Lines          2416     2428      +12     
  Branches        106      107       +1     
============================================
+ Hits           1931     1943      +12     
+ Misses          425      424       -1     
- Partials         60       61       +1     
Flag Coverage Δ
integration 80.02% <94.04%> (+0.09%) ⬆️
unit 78.56% <94.04%> (+0.10%) ⬆️

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

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

@aaron-steinfeld aaron-steinfeld merged commit f524365 into main Jun 7, 2024
11 checks passed
@aaron-steinfeld aaron-steinfeld deleted the declare-timeouts branch June 7, 2024 17:24
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