tag:github.com,2008:/dustin/java-memcached-client/commits/masterRecent Commits to java-memcached-client:master2017-08-03T03:55:31Ztag:github.com,2008:Grit::Commit/c232307ad8e0c7ccc926e495dd7d5aad2d713318
Add support for turning on tcp keep alive.
2017-08-03T03:55:31Zyoungmhttps://github.com/youngm
<pre style='white-space:pre-wrap;width:81ex'>Add support for turning on tcp keep alive.
Change-Id: Ic561f87fe262782a607e86ac8b2e0efb69d2c46e
Reviewed-on: http://review.couchbase.org/81810
Reviewed-by: Matt Ingenthron &lt;matt@couchbase.com&gt;
Tested-by: Matt Ingenthron &lt;matt@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/8fe2e33708e2a6e4620a8d7e53a17cb4e7aa2eaf
SPY-195: Defer String Concat in handleEmptySelects()
2017-04-10T16:43:32Zamcrnhttps://github.com/amcrn
<pre style='white-space:pre-wrap;width:81ex'>SPY-195: Defer String Concat in handleEmptySelects()
MemcachedConnection.handleEmptySelects() has a debug level log
statement that doesn&#39;t correctly defer the concatentation of
the argument until it has determined that the level is enabled.
Change-Id: I3c8bb70cfaa9f47eb790f2eb150bacca2ce839b6
Reviewed-on: http://review.couchbase.org/76567
Reviewed-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;
Tested-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;</pre>
tag:github.com,2008:Grit::Commit/e1979df8f4e585b8afac7c0bae5c0a230eb07bcf
SPY-194: Allow to optionally bound retry queue.
2017-04-07T06:02:15Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-194: Allow to optionally bound retry queue.
Motivation
----------
If the retry queue might grow very large this can lead to
uncontrollable side effects (like heap growth), since this
queue is not accessible from the outside of spymemcached.
Modifications
-------------
This change adds the system property &quot;net.spy.retryQueueSize&quot; which
allows to optionally bound the retry queue to the given size.
Note that to maximize backwards compatibility and to not introduce
any regressions the actual queue has not been changed but rather
the code which inserts into this queue is now checking for the
limit.
If the queue is full the operation is cancelled instead of sending
it into the retry queue.
Result
------
It is now possible to bound the retry queue.
Change-Id: I86452ef8dcddcf2c4acfc065fd9db94510665ac3
Reviewed-on: http://review.couchbase.org/69938
Tested-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;
Reviewed-by: Sergey Avseyev &lt;sergey.avseyev@gmail.com&gt;</pre>
tag:github.com,2008:Grit::Commit/e64b117849ad5e96311f6147f9a88f7f819527c2
SPY-193: Allow to override wakeupDelay
2017-03-14T09:16:28Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-193: Allow to override wakeupDelay
Motivation
----------
As part of SPY-172, a new wakeupDelay setting has been introduced,
but as part of a mistake it has never been used to actually set
the wakeup time, which is still hardcoded to 1000.
Modifications
-------------
This simple change modifies the code so it accepts the wakeupDelay
setting, still having the default at 1000 but making it possible
to override it through the system property.
Result
------
The wakeupDelay can now be configured via a system property.
Change-Id: If1273cb560d49ea2c9c42b7c7b70c84fd9aeebdc
Reviewed-on: http://review.couchbase.org/75116
Tested-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;
Reviewed-by: Sergey Avseyev &lt;sergey.avseyev@gmail.com&gt;</pre>
tag:github.com,2008:Grit::Commit/2b6e3bbc823aa68d7aa5b7f3bb8ece1b2c284d0e
SPY-192: Ensure connection key is valid before checking if writable.
2017-02-01T07:00:00Zggrochowhttps://github.com/ggrochow
<pre style='white-space:pre-wrap;width:81ex'>SPY-192: Ensure connection key is valid before checking if writable.
Motivation
----------
It has been discovered in the wild that sometimes CancelledKeyException are
received even if the key has been checked for validity before. It turns out
that the validity can change between the check and the next function call.
Modifications
-------------
The changeset makes sure to check if it is valid on both reading and
subsequent writing, reducing the chance of race conditions and interleaved
state changes.
Result
------
More stable behavior at runtime and less chance of CancelledKeyException.
Change-Id: Ic0db65f9c7ccc3a7b9738aaff0e3c7e60d7f25c2
Reviewed-on: http://review.couchbase.org/72270
Reviewed-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;
Tested-by: Michael Nitschinger &lt;michael@nitschinger.at&gt;</pre>
tag:github.com,2008:Grit::Commit/fd7e071a418411cf11cc0ddf290aced073412b3b
SPY-191: Don't force reconnect on E2BIG with binary protocol.
2016-04-04T10:41:31Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-191: Don&#39;t force reconnect on E2BIG with binary protocol.
Motivation
----------
In the current codebase, a socket is forcefully reset when the server
returns an E2BIG response, that is when the document is larger than the
possible value size.
Modifications
-------------
While this needs to be done on the ASCII protocol, doing so is not needed
with binary protocol and can be considered a bug/leftover.
The code is modified so that E2BIG just translates into a non-success response
like any other error and the proper error code identifies the cause.
The test cases have been modified for binary to reflect the change.
Result
------
Do not force reconnect / treat the issue as a server error on the binary
protocol - the ASCII protocol is unaffected.
Change-Id: Idf392d146d30b2e96dc198a93a3cc6598dae3fc6
Reviewed-on: http://review.couchbase.org/61927
Reviewed-by: Simon Baslé &lt;simon@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Sergey Avseyev &lt;sergey.avseyev@gmail.com&gt;</pre>
tag:github.com,2008:Grit::Commit/905c13c1d3453d882e80f48d18bdfecdeadc6d24
SPY-190: Remove the no-operation isInterrupted() call. Document inter…
2016-01-13T18:49:19Zchristian-eskenhttps://github.com/christian-esken
<pre style='white-space:pre-wrap;width:81ex'>SPY-190: Remove the no-operation isInterrupted() call. Document interruption policy.
Motivation
----------
Avoid confusion. Make the interruption policy more clear.
Modifications
-------------
Remove the no-operation isInterrupted() call.
Document interruption policy.
Result
------
Better understandable concurrency code.
Change-Id: Iaf63f8a246c45e9ed9ebfe9c4239043cbe9e2039
Reviewed-on: http://review.couchbase.org/58266
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/41cf86b39b0804cdb9bdf35574b7f8afbbef7102
SPY-187: Expose a few more attributes of MemcachedClient
2015-06-11T09:38:26Zfabienrenaudhttps://github.com/fabienrenaud
<pre style='white-space:pre-wrap;width:81ex'>SPY-187: Expose a few more attributes of MemcachedClient
Motivation
----------
Extending MemcachedClient to access some of its protected attributes is
not always desirable as it makes harder writing mocks for unit testing.
Modifications
-------------
MemcachedClient now exposes operationTimeout,
mconn, tcService and executorService.
Result
------
One does not have to extend MemcachedClient any more to write custom
commands.
Change-Id: I81932da64d4492512dcf1a11fe1161203fa70c5e
Reviewed-on: http://review.couchbase.org/51546
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/ce08f5069e3d5c90ea99f682bbd3517250d57ca4
Support Libmemcached ketama weighted
2015-05-19T05:46:13Zsideshowcoderhttps://github.com/sideshowcoder
<pre style='white-space:pre-wrap;width:81ex'>Support Libmemcached ketama weighted
- Add support for alternative Ketama Node key format
Libmemcached uses the format for `[hostname or ip][port unless
default]-[repetition]` while spymemcached has been using
`[hostname]/[ip]:[port]-[repetition]` the added `KetamaNodeKeyFormat`
allows to choose either format while retaining the caching
optimization.
- Add support for weighted ketama
Straight port of the weighting based on Libmemcached, configured via
passing a map of node socketaddress to weight to the configuration.
This code is only active if the weight is actually configured
otherwise the old ketama code is used.
- Split testLibKetamaCompatTwo into 2 pieces as the length breaks
compiling on Eclipse and Java 8 &quot;In java a methods can&#39;t have more than
65535 bytes.&quot; http://stackoverflow.com/questions/12257398/how-to-fix-the-code-of-method-is-exceeding-the-65535-bytes-limit
Change-Id: I0263b9afc513f9a135d5d17318b3fe6bd4593437
Reviewed-on: http://review.couchbase.org/47624
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/53d14b34ac9e84e0d2fc6c9a6ded430146453a64
SPY-183: Allow touch operations to be cloned.
2015-03-11T08:27:56Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-183: Allow touch operations to be cloned.
Motivation
----------
In case a touch operation needs to be rescheduled, it needs to
be cloneable (like any other keyed operation).
Modifications
-------------
Apply the same clone logic as with any other keyed operation. Also
added getter methods to the operations so that the expiration time
can be extracted on cloning.
Result
------
Correct behavior when a touch op needs to be cloned.
Change-Id: Iad343b4dbdcd5dfd4d9ec53bf5335dcf4775f9c9
Reviewed-on: http://review.couchbase.org/48076
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Simon Baslé &lt;simon@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/4bb435b7b58b78d650aad5019cd5c1569359257b
Fix spring unit tests.
2015-01-19T09:12:38Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>Fix spring unit tests.
Motivation
----------
afterPropertiesSet() needs to be called on the factory to actually
create the client so that it does not result in a NPE.
Change-Id: I483c045451f90ff3ed01d00db7e912e7d2484b64
Reviewed-on: http://review.couchbase.org/45554
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Simon Baslé &lt;simon@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/0283051a2141668e86e65fddafc14d5dcc905ee8
SPY-181: GetAndLock needs to be cloneable like any other keyed op.
2015-01-09T11:25:05Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-181: GetAndLock needs to be cloneable like any other keyed op.
Motivation
----------
In case a getAndLock operation needs to be rescheduled, it needs to
be cloneable (like any other keyed operation).
Modifications
-------------
Apply the same clone logic as with any other keyed operation. Also
added getter methods to the operations so that the expiration time
can be extracted on cloning.
Result
------
Correct behavior when a getAndLock op needs to be cloned.
Change-Id: I7f4fdad62af71a42cc203b2a4b7e72f2002a286d
Reviewed-on: http://review.couchbase.org/45129
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Simon Baslé &lt;simon@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/f896fd5349030ca94eea1adc6a8f1dfdfcdfd1df
SPY-182: Avoid WARN logging when handling node not set.
2015-01-09T11:25:01Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-182: Avoid WARN logging when handling node not set.
Motivation
----------
The main purpose of setting a continous timeout on a node is to
properly reconnect when the threshold is reached. Now if auth
has not happened yet, it could be that ops do not have a handling
node set yet.
In those cases, it doesn&#39;t make any sense to increase the counter,
so it should be ignored. This also has the side effect of not logging
warnings to the user which have no impact for him.
Modifications
-------------
Ignore the operation when its handling node is not set.
Result
------
No unnecessary warnings printed to the user.
Change-Id: I3643d5e0bfc7474889279d0f8362f287624b89a3
Reviewed-on: http://review.couchbase.org/45131
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Simon Baslé &lt;simon@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/79189468dcc3d26597b154dba53ff2959b8d046b
Change MemcachedNodeROImpl and BaseGetOpImpl classes to public.
2015-01-09T11:24:39Zfabienrenaudhttps://github.com/fabienrenaud
<pre style='white-space:pre-wrap;width:81ex'>Change MemcachedNodeROImpl and BaseGetOpImpl classes to public.
Motivation
----------
Implementing a custom NodeLocator requires to override the getReadonlyCopy
method which in turn requires to use some MemcachedNode implementation.
MemcachedNodeROImpl should be reusable outside of its package for that
purpose. In addition, memcached being an open source project, its
implementation can be changed or extended and commands such as GET may
be used differently in these custom versions. The abstract BaseGetOpImpl
should be flexible enough to be adapted to different but similar GET
commands.
Modifications
-------------
The MemcachedNodeROImpl class accessor changes from package-private to public.
The BaseGetOpImpl class accessor changes from package-private to public.
The initialization method and constructors of BaseGetOpImpl changed to
abstract the string appended to the &lt;GET key&gt; command.
Result
------
Writing a custom NodeLocator outside of the net.spy.memcached package
and supporting variants of GET commands is now easy.
Change-Id: I49b3efc741ab4fe5780bf74ad5f99b839c9ceb7d
Reviewed-on: http://review.couchbase.org/44565
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/95833c9927d9996d5f3e781f2441a7df16cb8479
Update Spring FactoryBean to properly support isSingleton property
2014-12-10T12:03:29Zmattbertolinihttps://github.com/mattbertolini
<pre style='white-space:pre-wrap;width:81ex'>Update Spring FactoryBean to properly support isSingleton property
Motivation
----------
The current MemcachedClientFactoryBean is marked as a singleton to Spring but
does not respect the flag. It is creating a new instance with every call to
getObject(). According to the Spring Javadoc a FactoryBean marked with
isSingleton true should always return the same reference. By doing this it
will also expose an ability to safely shutdown a client instance.
Modifications
-------------
The class was updated to implement the Spring InitializingBean and
DesposableBean interfaces. These interfaces provide the two key lifecycle
methods to create and shutdown the client object. The afterPropertiesSet is
called after the FactoryBean is constructed and all of the properties have
been set. This will create the client object and store it in a field so the
same reference can be returned. The destroy method is called when closing the
Spring context. It will call the client&#39;s shutdown method. I have also added a
new property that allows a caller to specify the number of seconds to wait
before shutting down the client. This is a well established Spring pattern
that is used in many of their own FactoryBean implementations.
Result
------
A more accurate Factory bean that respects the Spring lifecycle and provides
a safe shutdown mechanism.
Change-Id: I9ae2d71ae7d3fe899bce8ec8200e215aa987400d
Reviewed-on: http://review.couchbase.org/44144
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/8af3ebbcc2cd74deee6e28350322dbc470f5164f
SPY-179: Reconnect has wrong ceiling, leading to very long reconnect …
2014-11-21T15:14:57Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-179: Reconnect has wrong ceiling, leading to very long reconnect delays.
Motivation
----------
This is a regression which was introduced through the change in SPY-158
(https://github.com/couchbase/spymemcached/commit/bfaec2b4f1385f20f32fd0ed0736b52ef572e340).
Because the time is now converted to millis right away, but the comparison checks with the 2^n
still converted to seconds. That way, even with a very high N it is smaller than the default of
30k.
Modifications
-------------
The code now correctly converts the 2^n to milliseconds before comparing it, making it a comparison
on the same unit of time again.
Result
------
The ceiling is now properly respected and as a result, reconnect delays are properly capped at
their defined maximum.
Change-Id: I0c976344d0f8e09bc041d94f3544620ef4fb3117
Reviewed-on: http://review.couchbase.org/42925
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Sergey Avseyev &lt;sergey.avseyev@gmail.com&gt;</pre>
tag:github.com,2008:Grit::Commit/be9e2ad99a06e4adaf6f133b4d60bff87c27f1fa
SPY-178: KetamaNodeLocator#getReadonlyCopy uses unsafe operations.
2014-11-10T08:34:38Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-178: KetamaNodeLocator#getReadonlyCopy uses unsafe operations.
Motivation
----------
Users reported java.lang.UnsupportedOperationException when using the
KetamaNodeLocator#getReadonlyCopy() method. It turns out the error
only shows up when the JVM is run with the -XX:+AggressiveOpts flag.
Modifications
-------------
Changing the iterator to properly update the TreeMap while iterating
fixes the problem.
Result
------
Correct behavior for KetamaNodeLocator#getReadonlyCopy(), even when
the -XX:+AggressiveOpts flag is enabled.
Change-Id: I6e7f09892687b8896c9b295a94fb473857ec212f
Reviewed-on: http://review.couchbase.org/43040
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Reviewed-by: Sergey Avseyev &lt;sergey.avseyev@gmail.com&gt;</pre>
tag:github.com,2008:Grit::Commit/953c322ad254bf6f544bac6738114176040a9c6f
SPY-176: Enhance redistribution logic and avoid possible deadlocks.
2014-06-24T06:55:24Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-176: Enhance redistribution logic and avoid possible deadlocks.
Motivation
----------
There have been issues reported that redistribution of operations does
not work as expected, especially with authentication scenarios. This
has been tracked down and the following changes have been made:
Modifications
-------------
- With the old redistribute logic, it could happen that subsequent
ops in the retry queue got accidentally deleted. With the copy
first, this cannot happen anymore.
- On redistribute, if the handling node is still not set, just
clone the operation to avoid NPEs. A op without a node set
can happen if it is enqueued to retry because the target node
is not yet authenticated.
- Do not try to add operations to a node which is not yet authen
ticated. This can lead to costly locks with redistributions since
they are run from the IO thread. Without the change, it can happen
that the IO thread waits for an auth latch, but is also responsible
for telling listeners when auth has completed, therefore
locking everything up until the auth latch wait runs out of time.
Result
------
Much better resilience and performance with redistributions, especially
if authentication takes longer than expected and from scenarios where the
operations get redistributed/moved around from within the IO thread.
Change-Id: Icbc5f9e4f568ea885500e8d2baedfa989c8ef801
Reviewed-on: http://review.couchbase.org/38669
Reviewed-by: Matt Ingenthron &lt;matt@couchbase.com&gt;
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/ca3c8d4c1d69608bdb7b8b93c0b6a95d3361b947
SPY-175: Reduce memory use in binary GET
2014-06-17T07:59:06Ztootedomhttps://github.com/tootedom
<pre style='white-space:pre-wrap;width:81ex'>SPY-175: Reduce memory use in binary GET
Change-Id: I9b90aab0b54a2ae7d2c262d499ff47482b9d6c6c
Reviewed-on: http://review.couchbase.org/38359
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>
tag:github.com,2008:Grit::Commit/5911705aa18e3bee813fc3f98d6087e1d43a1599
SPY-174: Make sure MultiOperationCallback is threadsafe
2014-06-17T07:58:52Zdaschlhttps://github.com/daschl
<pre style='white-space:pre-wrap;width:81ex'>SPY-174: Make sure MultiOperationCallback is threadsafe
First, special thanks goes to @exortech for reporting and fixing the issue
here: https://github.com/dustin/java-memcached-client/pull/9
Motivation
----------
Certain operations like the multi get callback rely on the multi operation
callback which has a non-thread safe component to it.
Modification
------------
Make the callback atomic and thread safe.
Result
------
No race conditions with bulk get operation callbacks.
Change-Id: I511a8e5ec6e8fe50168337a4b9bbddf2360bd365
Reviewed-on: http://review.couchbase.org/38358
Reviewed-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;
Tested-by: Michael Nitschinger &lt;michael.nitschinger@couchbase.com&gt;</pre>