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

Query packet size limit in version ^0.2.0 ? #122

Open
anderfjord opened this issue Nov 5, 2015 · 3 comments
Open

Query packet size limit in version ^0.2.0 ? #122

anderfjord opened this issue Nov 5, 2015 · 3 comments

Comments

@anderfjord
Copy link

My app uses phantomjs to take a screenshot and then stores the resulting base64 string in mysql. This had been working fine with node-mariasql v0.1.22 running on node v0.12, but now I'm getting the following error with node-mariasql ^0.2.0 running on node v4.2.1:

mysql error, reconnecting.. -> Error: MySQL server has gone away

This seems to point to either a timeout or packet size limitation. I suspect it's a size limitation, since smaller screenshots don't trigger the problem, only larger ones. I have reviewed the breaking changes list [https://github.com/mscdex/node-mariasql/wiki/Upgrading-v0.1.x-to-v0.2.x] and appear to have accounted for all other factors.

I'd really appreciate any help with this. Thanks very much.

@mscdex
Copy link
Owner

mscdex commented Nov 5, 2015

Do you have a simple, reproducible test case? As far as I know nothing has changed packet size-wise. If anything, it might be that the keepalive mechanism changed somewhat.

@anderfjord
Copy link
Author

I've added a small repo to reproduce this. The readme should be pretty self explanatory, but let me know if you have any questions.

https://github.com/wreckloose/mariasql-query-size-test

You'll have to use the screenshots.sql file to add a test table to one of your databases. Modify the db config in run.js to point to your database.

Usage:
node run.js -f small.txt
node run.js -f medium.txt
node run.js -f large.txt

Only the first test case runs successfully. Note that the unsuccessful test cases die almost immediately. In other words, they don't run for a long time and then die.

Thanks again for your help.

@mscdex
Copy link
Owner

mscdex commented Nov 14, 2015

Ok, so the problem is on the server-side and its max-allowed-packet configuration, so I'm not sure why it would have broke for you when upgrading mariasql.

For example, when I start up mariadb 10.1.8 with --no-defaults, it uses a ~4MB max-allowed-packet size. This let me execute your small and medium tests without a problem. However the large is ~5MB and is thus larger than the allowed packet size. Bumping the value up on the server side allowed the large test to complete successfully.

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

No branches or pull requests

2 participants