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 cannot read response data included terminator when use meta protocol #1007

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matsubara0507
Copy link

if meta protocol get response data included terminator \r\n then occur error

  1) Error:
operations::using the meta protocol::get#test_0002_return the value that include TERMINATOR on a hit:
Dalli::UnmarshalError: Unable to unmarshal value: marshal data too short
    lib/dalli/protocol/value_serializer.rb:65:in `filter_argument_error'
    lib/dalli/protocol/value_serializer.rb:51:in `rescue in retrieve'
    lib/dalli/protocol/value_serializer.rb:45:in `retrieve'
    lib/dalli/protocol/value_marshaller.rb:44:in `retrieve'
    lib/dalli/protocol/meta/response_processor.rb:35:in `meta_get_with_value'
    lib/dalli/protocol/meta.rb:30:in `get'
    lib/dalli/protocol/base.rb:36:in `request'
    lib/dalli/options.rb:18:in `block in request'
    lib/dalli/options.rb:17:in `synchronize'
    lib/dalli/options.rb:17:in `request'
    lib/dalli/client.rb:426:in `perform'
    lib/dalli/client.rb:64:in `get'
    test/integration/test_operations.rb:32:in `block (6 levels) in <top (required)>'
    test/helpers/memcached.rb:41:in `memcached'
    test/helpers/memcached.rb:50:in `memcached_persistent'
    test/integration/test_operations.rb:27:in `block (5 levels) in <top (required)>'

Meta get response include size of data block.
ref. https://github.com/memcached/memcached/blob/1.6.29/doc/protocol.txt#L519

Therefore, changed to read response data using size instead of terminator.

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

Successfully merging this pull request may close these issues.

1 participant