-
Notifications
You must be signed in to change notification settings - Fork 761
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(KeyValueStore): big buffers should not crash #1734
Conversation
@vladfrangu Have you confirmed this also fixes the performance issues? In our issue (#1710) we experienced horrendous perf problems from shapeshift handling Buffers (to the extent it started blocking Node's event loop). Asking as I see the buffer test in this PR is also showing perf issues. |
Its most likely that you're having those performance issues due to shapeshift interpreting the buffer as an object, and trying to parse its fields (given that a buffer is basically an array of bytes, you can guess what happens when size is big) This PR should shortcircuit that check since any buffer is an instance of a buffer, and thus speed up tremendously... That said, if you can test it yourself that would be awesome! I'll try it out locally too) |
We'll test locally
Thanks, glad you worked out the solution quickly. Have a gr8 year everyone! |
@vladfrangu @B4nan Some bad news: we've just tested this (via Crawle v3.3.0) and the issue persists. It's slightly less pervasive than prior to this PR but still present (affects about 40% of our spiders, with same symptom as before: pegged event loop, causing degraded request throughput and in many cases spider crash). Workaround for us has been to apply the following patch to
Applying the patch immediately resolved the issue. |
Closes #1732
Closes #1710
Simple fix really, tell shapeshift inputs can be buffers too (I'll also see if we can add a generic "just check that its an object" in shapeshift for times like these)