Skip to content

fix: redis connect with promise race - #2107

Merged
anantjain45823 merged 39 commits into
developfrom
fix.redis-connector
May 17, 2023
Merged

anantjain45823 merged 39 commits into
developfrom
fix.redis-connector

Conversation

@koladilip

Copy link
Copy Markdown
Contributor

Description of the change

timeoutPromise should be a function so that it returns a new promise everytime.

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

timeoutPromise should be a function so that it returns a new
promise everytime.
@koladilip
koladilip requested a review from a team April 27, 2023 17:41
anantjain45823
anantjain45823 previously approved these changes Apr 27, 2023
timeoutPromise should be a function so that it returns a new
promise everytime.

Also we should use reject so that it will error if timed out.
@codecov

codecov Bot commented Apr 27, 2023 •

Copy link
Copy Markdown

Codecov Report

Patch coverage: 94.55% and project coverage change: +0.09 🎉

Comparison is base (c126f7b) 88.47% compared to head (f6275bb) 88.57%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2107      +/-   ##
===========================================
+ Coverage    88.47%   88.57%   +0.09%     
===========================================
  Files          507      507              
  Lines        25690    25709      +19     
  Branches      6373     6354      -19     
===========================================
+ Hits         22730    22772      +42     
+ Misses        2644     2623      -21     
+ Partials       316      314       -2     
Impacted Files Coverage Δ
src/util/prometheus.js 7.69% <ø> (ø)
src/util/redis/redisConnector.js 94.36% <94.36%> (ø)
src/v0/sources/shopify/util.js 97.02% <94.44%> (+14.88%) ⬆️
src/v0/sources/shopify/transform.js 97.65% <95.23%> (-0.61%) ⬇️
src/v0/sources/shopify/config.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

yashasvibajpai
yashasvibajpai previously approved these changes Apr 27, 2023
anantjain45823
anantjain45823 previously approved these changes Apr 27, 2023
Comment thread src/util/redisConnector.js Resolved
@anantjain45823
anantjain45823 dismissed stale reviews from yashasvibajpai and themself via 7329602 April 28, 2023 09:22
@anantjain45823
anantjain45823 requested a review from a team as a code owner April 28, 2023 09:22
Comment thread src/v0/sources/shopify/transform.js Resolved
Comment thread src/v0/sources/shopify/transform.js Resolved
Comment thread src/v0/sources/shopify/transform.js Resolved
Comment thread src/v0/sources/shopify/util.js Resolved
@koladilip

Copy link
Copy Markdown
Contributor Author

LGTM

@sanpj2292

Copy link
Copy Markdown

[Non-blocking] I don't think errorType: "Redis" is making a lot of sense as the metric itself contains .*redis.*. Can we either get rid of the label or think about putting some other detail which thoroughly describes the problem ?

@anantjain45823

Copy link
Copy Markdown
Contributor

[Non-blocking] I don't think errorType: "Redis" is making a lot of sense as the metric itself contains .*redis.*. Can we either get rid of the label or think about putting some other detail which thoroughly describes the problem ?

I guess we can rename it to RedisConnection as its the only error we are getting in dev. Otherwise we can use custom error. WDYT @sanpj2292

@sanpj2292

sanpj2292 commented May 2, 2023 •

Copy link
Copy Markdown

Let's not have errorType now as the setting or getting, can be due to something else.
I'd say have one stat redis_error or something similar(that tells there is an error when operating on redis), where in your label can be something like operation. This label operation indicates when the error was thrown and the types of operation are createConnection, quitConnection, get, set etc,.

And as another label, we can have key, which makes a lot of sense to know if while getting or setting a particular key in Redis, we are facing some problem(I'm thinking this would not be that common a scenario)

This would give a lot clear picture when you're looking at stats around redis in transformer

@koladilip @utsabc any thoughts here ?

@koladilip

Copy link
Copy Markdown
Contributor Author

@anantjain45823 can you resolve these conflicts?

Comment thread src/util/redis/redisConnector.js Resolved
@anantjain45823

Copy link
Copy Markdown
Contributor

@anantjain45823 can you resolve these conflicts?

Conflicts resolved

sanpj2292
sanpj2292 previously approved these changes May 15, 2023

@koladilip koladilip left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM

Comment thread src/v0/sources/shopify/util.js Resolved
Comment thread src/util/redis/redisConnector.js Resolved
sanpj2292
sanpj2292 previously approved these changes May 16, 2023
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

92.4% 92.4% Coverage
0.0% 0.0% Duplication

@anantjain45823
anantjain45823 merged commit d439485 into develop May 17, 2023
@sanpj2292
sanpj2292 deleted the fix.redis-connector branch May 17, 2023 13:48
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.

7 participants