Skip to content

fix(sequelize/query): closes #2113, closes #8022, closes #8014 - #8961

Closed
yocontra wants to merge 0 commit into
sequelize:masterfrom
yocontra:master
Closed

yocontra wants to merge 0 commit into
sequelize:masterfrom
yocontra:master

Conversation

@yocontra

@yocontra yocontra commented Jan 29, 2018 •

Copy link
Copy Markdown
Contributor

Pull Request check-list

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

  • Wraps the entire query process in retry, instead of just the query.
  • Failed queries will yield the connection back to the pool, and request another one on the next retry
    • This allows the retry functionality to work with the pool reconnect functionality 💯

There are a few failing tests I think should be removed, but I'm opening this for discussion. The test that ensures the connection release is called only once seems wrong to me, if you're going to be retrying for 60 seconds (or longer!) shouldn't you yield the connection between tries? Otherwise the pool will get completely hosed with connections that are doing nothing but waiting for the next retry. That test was added to close a ticket that would also be solved with this change.

Anyways, let me know what you think RE tests. We're using this already on test servers and it seems to work great - I can restart the db or shut it off for a while and when I turn it back on the queries resolve just fine. This makes zero downtime multi-az failovers work 100%.

@sushantdhiman

Copy link
Copy Markdown
Contributor

Thanks for this PR @contra , I will take care of cleaning up tests

@yocontra

yocontra commented Feb 2, 2018

Copy link
Copy Markdown
Contributor Author

@sushantdhiman Thanks! Let me know if you need anything else.

@sushantdhiman

Copy link
Copy Markdown
Contributor

Somehow cant push to contra/master forcefully, will reopen another PR

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.

2 participants