Fix ThreadIO dying when data is too large #16
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Max data size in CachedData is not enough.
Indeed Memcached configuration is about the max item size which includes:
key, value and the item_struct sizes.
Checking the value size is not enough. ERR_2BIG can be triggered.
When EER_2BIG is triggered, the operation is marked as completed as soon as the server has answered with the error code.
The write operation is still in the write queue as there are bytes remaining to be written.
A NullPointerException is then throwned since the operation buffer is cleared when it is marked completed.
Finally the ThreadIO dies as it does not catch this type of exception.