MOD: don't re-set the libmemcached option if not modified#451
Merged
sodabrew merged 1 commit intophp-memcached-dev:masterfrom Oct 9, 2020
Merged
Conversation
Contributor
Author
|
@sodabrew can you take time to review this PR? |
sodabrew
reviewed
Mar 11, 2020
Collaborator
sodabrew
left a comment
There was a problem hiding this comment.
Thank you for debugging this disconnect, I think it may explain several other bugs indicating that Binary mode doesn't perform as expected. Just one style nit noted.
I want to check against any fallout if there are "behaviors" that are set through memcached_behavior_set that are more like Linux ioctls, that can be sort of any value you're trying to pass, and not necessarily set-once settings. I don't know if any such things exist, but I want to confirm before merging.
| if (flag < MEMCACHED_BEHAVIOR_MAX) { | ||
| // do set the option when the option value wasn't modified, | ||
| // while libmemcached may shutdown all the connection. | ||
| if (memcached_behavior_get(intern->memc,flag) == (uint64_t)lval) { |
52a2cbe to
b51433b
Compare
Contributor
Author
|
@sodabrew yeah, it should check the option value was modified or not in |
9a62da1 to
36f18bf
Compare
libmemcached would close all connections if the option(like MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) was set, even though value wasn't modified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
libmemcached would close all connections if the option(like MEMCACHED_BEHAVIOR_BINARY_PROTOCOL) was set, even though the value wasn't modified. If the user uses the setOptions in the wrong way may cause the persistent connection never works.