We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
XMemcachedClient.invalidateNamespace(String) not work if XMemcachedClient.sanitizeKeys=true.
XMemcachedClient.invalidateNamespace(String)
XMemcachedClient.sanitizeKeys=true
The reason is, namespace will be encoded when invalidating while it will not be encoded when getting.
public void invalidateNamespace(String ns, long opTimeout) throws MemcachedException, InterruptedException, TimeoutException { String key = this.getNSKey(ns); this.incr(key, 1, System.currentTimeMillis(), opTimeout); // this method calls preProcessKey, which encodes ns } ... private <T> Object get0(String key, final long timeout, final CommandType cmdType, final Transcoder<T> transcoder) throws TimeoutException, InterruptedException, MemcachedException { key = this.preProcessKey(key); // calls getNamespace byte[] keyBytes = ByteUtils.getBytes(key); ByteUtils.checkKey(keyBytes); return this.fetch0(key, keyBytes, cmdType, timeout, transcoder); } ... public String getNamespace(String ns) throws TimeoutException, InterruptedException, MemcachedException { String key = this.keyProvider.process(this.getNSKey(ns)); byte[] keyBytes = ByteUtils.getBytes(key); ByteUtils.checkKey(keyBytes); Object item = this.fetch0(key, keyBytes, CommandType.GET_ONE, this.opTimeout, this.transcoder); // get namespace without encoding while (item == null) { item = String.valueOf(System.nanoTime()); boolean added = this.add0(key, 0, item, this.transcoder, this.opTimeout); if (!added) { item = this.fetch0(key, keyBytes, CommandType.GET_ONE, this.opTimeout, this.transcoder); } } String namespace = item.toString(); if (!ByteUtils.isNumber(namespace)) { throw new IllegalStateException( "Namespace key already has value.The key is:" + key + ",and the value is:" + namespace); } return namespace; }
The text was updated successfully, but these errors were encountered:
Thanks, it's a bug, i will fix it ASAP.
Sorry, something went wrong.
(fix) invalidateNamespace not work when sanitizeKeys is true, issue #85
5b7611b
Fixed in 2.4.5
https://github.com/killme2008/xmemcached/releases/tag/xmemcached-2.4.5
It may take some time to be synced into maven central repository.
killme2008
No branches or pull requests
XMemcachedClient.invalidateNamespace(String)
not work ifXMemcachedClient.sanitizeKeys=true
.The reason is, namespace will be encoded when invalidating while it will not be encoded when getting.
The text was updated successfully, but these errors were encountered: