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

fix #1710: async pooling bug in MySQL #1712

Merged

Conversation

shubha-rajan
Copy link
Contributor

Fixes #1710

Ensures that the pool and table are created before serving any requests.

@shubha-rajan shubha-rajan requested a review from kurtisvg as a code owner April 9, 2020 21:41
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Apr 9, 2020
@shubha-rajan shubha-rajan force-pushed the fix-mysql-pooling-bug branch from ad39b71 to 2e6f585 Compare April 9, 2020 22:51
);
console.log(`Ensured that table 'votes' exists`);
} catch (e) {
console.log(`Got error: ${e}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this fail instead of just catch and throw?


createPool()
.then(() => (schemaReady = ensureSchema()))
.catch((error) => console.log(error));
Copy link
Contributor

Choose a reason for hiding this comment

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

Same with this - does it fail the execution if this pool doesn't start?

cloud-sql/mysql/mysql/server.js Show resolved Hide resolved
@kurtisvg kurtisvg requested a review from grayside April 10, 2020 00:08
@fhinkel
Copy link
Contributor

fhinkel commented Apr 10, 2020

I'll wait with the merge until @kurtisvg 's comments are approved

@kurtisvg kurtisvg removed the request for review from grayside April 10, 2020 16:48
Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

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

The feedback from @kurtisvg was spot on. In general, we should avoid capturing and swallowing errors. Let it throw!

@fhinkel
Copy link
Contributor

fhinkel commented Apr 20, 2020

@JustinBeckwith do you still have objections for this PR?

@fhinkel
Copy link
Contributor

fhinkel commented Apr 20, 2020

@shubha-rajan Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix for MySQL Pooling Async Bug
5 participants