-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix #1710: async pooling bug in MySQL #1712
Conversation
ad39b71
to
2e6f585
Compare
cloud-sql/mysql/mysql/server.js
Outdated
); | ||
console.log(`Ensured that table 'votes' exists`); | ||
} catch (e) { | ||
console.log(`Got error: ${e}`); |
There was a problem hiding this comment.
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?
cloud-sql/mysql/mysql/server.js
Outdated
|
||
createPool() | ||
.then(() => (schemaReady = ensureSchema())) | ||
.catch((error) => console.log(error)); |
There was a problem hiding this comment.
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?
I'll wait with the merge until @kurtisvg 's comments are approved |
There was a problem hiding this 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!
09d9586
to
a8b7e21
Compare
@JustinBeckwith do you still have objections for this PR? |
@shubha-rajan Thanks for the fix! |
Fixes #1710
Ensures that the pool and table are created before serving any requests.