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

1827 Apply executeWithRetries and the network one throughout #2285

Merged
merged 4 commits into from
Jun 19, 2024

Conversation

leite08
Copy link
Member

@leite08 leite08 commented Jun 15, 2024

Ref. metriport/metriport-internal#1827

Dependencies

Description

Follow-up to #2272, this attempts to add retries (mostly network ones) to calls to external services.

  • executeWithRetries: by default, retry on every error
  • executeWithNetworkRetries: by default, retry only on ECONNREFUSED and ECONNRESET

Refactor some logic especially around error handling.

Upgrade Axios to 1.4.0 to match API's.

Testing

  • Local
    • PD works
    • DQ works
    • DR works
    • Listing documents works
    • Converting document to PDF works No local impl
  • Staging
    • PD works
    • DQ works
    • DR works
    • Listing documents works
    • Converting document to PDF works
    • Search documents
    • Bulk download doc URLs
  • Sandbox
    • none
  • Production
    • none

Release Plan

  • Publish NPM packages
  • Merge this

@leite08 leite08 force-pushed the 1827-update-lambdas-to-retry branch from 6dc7f4e to 503f583 Compare June 15, 2024 21:32
Comment on lines +35 to +45
const patient = patientDB.dataValues;
return {
...patient,
data: {
...patient.data,
externalData: {
...patient.data.externalData,
COMMONWELL: cwData,
},
},
};
Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid casting

@leite08 leite08 marked this pull request as ready for review June 15, 2024 21:42
Copy link
Member

@jonahkaye jonahkaye left a comment

Choose a reason for hiding this comment

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

My main concern here is with using executeWithRetries not at the lowest possible level. My heuristic would be to always put it actually in the file that uses axios or the s3 sdk or the cw sdk as opposed to a more upstream function. I think of the retries as a low level protocol that should be done as close to the call to the external service as possible.

thoughts?

@leite08 leite08 force-pushed the 1827-update-lambdas-to-retry branch 2 times, most recently from b279526 to 0ae10e7 Compare June 18, 2024 16:30
@leite08 leite08 force-pushed the 1827-update-lambdas-to-retry branch from 80aa04b to acf1231 Compare June 19, 2024 19:07
@leite08 leite08 force-pushed the 1827-update-lambdas-to-retry branch from acf1231 to 899a914 Compare June 19, 2024 20:55
@leite08 leite08 added this pull request to the merge queue Jun 19, 2024
Merged via the queue into develop with commit 056427f Jun 19, 2024
34 checks passed
@leite08 leite08 deleted the 1827-update-lambdas-to-retry branch June 19, 2024 20:57
This was referenced Jun 19, 2024
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.

None yet

2 participants