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

BC-1990 - Avoid async calls in the feathers setup method #3515

Merged
merged 9 commits into from
Jun 30, 2022

Conversation

virgilchiriac
Copy link
Contributor

@virgilchiriac virgilchiriac commented Jun 23, 2022

Description

Avoid race condition when db is not fully up, while the setup method,
aka service initialization, is called, which on occasion can happen on
deployment in K8 cluster.
Calling the db "too early" was essentially caching a bad response
like undefined in a prop of the class.

Links to Tickets or other pull requests

BC-1990

Changes

Datasecurity

Deployment

New Repos, NPM pakages or vendor scripts

Approval for review

  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

Avoid race condition when db is not fully up, while the setup method,
aka service initialization, is called, which on occasion can happen on
deployment in K8 cluster.
Calling the db "too early" was essentially caching a bad response
like undefined in a prop of the class.
@virgilchiriac virgilchiriac requested a review from CeEv June 23, 2022 07:26
@virgilchiriac
Copy link
Contributor Author

interesting topic: feathersjs/feathers#509 (comment)

Copy link
Contributor

@MartinSchuhmacher MartinSchuhmacher left a comment

Choose a reason for hiding this comment

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

I think your changes make a pretty good improvement here 👍

@virgilchiriac virgilchiriac merged commit 26f1487 into main Jun 30, 2022
@virgilchiriac virgilchiriac deleted the bc-1990-no-async-in-setup branch June 30, 2022 12:51
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