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

Add alloptions workaround. #1

Merged
merged 2 commits into from
Sep 27, 2016
Merged

Add alloptions workaround. #1

merged 2 commits into from
Sep 27, 2016

Conversation

joehoyle
Copy link
Member

Much like in
humanmade/memcache-object-cache@a471be4
we workaroudn the core behaviour of storing all options in a single
memcached object, which causes a lot of race conditions. Instead, we
hook in on add / set / get and delete and specially handle the
alloptions key, to split it up and store them each in their own
memcached object,

Much like in
humanmade/memcache-object-cache@a471be4
we workaroudn the core behaviour of storing all options in a single
memcached object, which causes a lot of race conditions. Instead, we
hook in on add / set / get and delete and specially handle the
alloptions key, to split it up and store them each in their own
memcached object,
Copy link
Member

@rmccue rmccue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, few minor changes to avoid an inefficiency.

@@ -1185,6 +1189,10 @@ public function delete( $key, $group = 'default', $time = 0, $server_key = '', $
return true;
}

if ( $key === 'alloptions' && $group === 'options' ) {
return $this->deleteAllOptions();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be moved above the other lines here.

@@ -1286,6 +1294,9 @@ public function get( $key, $group = 'default', $force = false, &$found = null, $
// Assume object is not found
$found = false;

if ( $key === 'alloptions' && $group === 'options' ) {
return $this->getAllOptions();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can also be moved to the top.

@joehoyle
Copy link
Member Author

Ok fixed up!

@joehoyle joehoyle merged commit 3af8ad0 into master Sep 27, 2016
@joehoyle joehoyle deleted the alloptions branch September 27, 2016 20:45
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.

2 participants