Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Commits on Jun 24, 2014
  1. @daschl

    SPY-176: Enhance redistribution logic and avoid possible deadlocks.

    daschl authored daschl committed
    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 <matt@couchbase.com>
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Jun 17, 2014
  1. @tootedom @daschl

    SPY-175: Reduce memory use in binary GET

    tootedom authored daschl committed
    Change-Id: I9b90aab0b54a2ae7d2c262d499ff47482b9d6c6c
    Reviewed-on: http://review.couchbase.org/38359
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  2. @daschl

    SPY-174: Make sure MultiOperationCallback is threadsafe

    daschl authored daschl committed
    First, special thanks goes to @exortech for reporting and fixing the issue
    here: #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 <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Jun 4, 2014
  1. @daschl

    SPY-172: Addition - test case fix.

    daschl authored daschl committed
    Just fixed the port.
    
    Change-Id: I82f55e8cef10c30bac785389b8d3c23d57553206
    Reviewed-on: http://review.couchbase.org/37839
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  2. @daschl

    SPY-172: Wakeup the selector if idle.

    daschl authored daschl committed
    Motivation
    ----------
    Waking the selector up from time to time and providing implementations a
    chance to run certain checks helps to improve robustness in certain
    situations.
    
    Modifications
    -------------
    The wakeup time is configurable through a system property, but is low
    impact even if set to a smaller value. If the added queue is empty (which
    means the selector has been woken up but no op has been added) a custom
    method is called where implementations can run custom code like idle polls.
    
    Result
    ------
    Better handling in idle situations.
    
    Change-Id: I43ea722b8a4fc28be4f997674ea85f73f2c66a50
    Reviewed-on: http://review.couchbase.org/37725
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-171: More robust shutdown handling characteristics.

    daschl authored daschl committed
    Motivation
    ----------
    It has been reported several times that the IO thread kept lingering
    around even after a shutdown() call.
    
    Modifications
    -------------
    Since its run() method is kept alive by the "running" variable, the
    code now makes sure to always set it to false, even if an exception
    occurs during the connection shutdown process.
    
    Also, a slightly misleading IOException has been removed in favor of
    just silently moving on if shutdown is in progress.
    
    Result
    ------
    More stable and predictable shutdown behavior.
    
    Change-Id: I99f3effbbb20a78a2705ee7f3f839e9753fb2a4a
    Reviewed-on: http://review.couchbase.org/37724
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Jun 2, 2014
  1. @daschl

    Move superfluous log message from info to debug.

    daschl authored daschl committed
    Motivation
    ----------
    In every log when connecting, a message like this shows up:
    
    INFO [Memcached IO over {MemcachedConnection to ...}] (?:?) - 
    Connection state changed for sun.nio.ch.SelectionKeyImpl@...
    
    This message is superfluous since it does not provide any addition 
    information to the user, especially not at INFO level.
    
    Modifications
    -------------
    The message has been moved to DEBUG level so that users are not 
    wondering what it means and also to streamline the log a bit.
    
    Result
    ------
    Easier log output to read and analyze for the user.
    
    Change-Id: I13ef691dd435f397dc9d5f08ff40a28202d3ddb7
    Reviewed-on: http://review.couchbase.org/37647
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  2. @daschl

    SPY-170: Fix concurrency issue in StringUtils.isJSONObject()

    daschl authored daschl committed
    Motivation
    ----------
    A concurrency issue was reported in the StringUtils class, pointing towards
    the pattern matching of the JSON string.
    
    Modifications
    -------------
    It turned out that the matcher is not thread safe and there is a race condition
    between clearing it and then matching on it. By falling back to the thread-safe
    builder directly the race condition goes away.
    
    Result
    ------
    No concurrency issue anymore in the helper method.
    
    Change-Id: I09729af78bd241ff8dcb0869992d3ff474fb6ec1
    Reviewed-on: http://review.couchbase.org/37603
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-134: Make sure lastReadTimestamp is concurrency safe.

    daschl authored daschl committed
    Motivation
    ----------
    When the last read timestamp is read from each node, there has been some
    suspicion that the (sometimes very long) reported times are flawed.
    
    Tracking it down further, it was discovered that the timestamp was potentially
    accessed by two or more threads, but not volatile.
    
    Modifications
    -------------
    This changeset makes the timstamp volatile and also uses nanoTime instead
    of currentTimeMillis for better accuracy.
    
    Result
    ------
    Since the timestamp is now thread safe, the actual value will now be shown
    to the user.
    
    Change-Id: I39e47408319f8adf3b2875a4a730232ecadeafe2
    Reviewed-on: http://review.couchbase.org/37646
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on May 7, 2014
  1. @daschl

    SPY-169: Also clone observe calls on redistribute.

    daschl authored daschl committed
    Motivation
    ----------
    Observe calls also need to be cloned when redistributed, for example if a socket
    gets closed or the op stil waits for an auth latch.
    
    Modifications
    -------------
    The observe operation now gets cloned similar to get, gets and so on.
    
    Result
    ------
    No assert error is raised if an observe needs to be cloned.
    
    Change-Id: I6269a1d7fb756855f94caa2fe0495133fe1a83b0
    Reviewed-on: http://review.couchbase.org/36698
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on May 5, 2014
  1. @daschl

    SPY-165: Do not cache the selectedKeys.

    daschl authored daschl committed
    Motivation
    ----------
    Caching the selected keys may cause issues if the selector is accessed by different
    threads, also the loop for the keys is not using the iterator correct.
    
    Modifications
    -------------
    Make it not cache the keys and also correctly make use of an iterator to loop through
    the keys.
    
    Result
    ------
    No stale/cached selected keys and correctly using the iterator should lead to better
    stability during failure cases.
    
    Thanks to Brad Svee (@sveesible) for suggesting the fix
    
    Change-Id: If82cdfc810c758a4196415cb709a03ebd72c3d15
    Reviewed-on: http://review.couchbase.org/36222
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  2. @daschl

    SPY-166: Only readd a WRITE_QUEUED operation, not clone it in addition.

    daschl authored daschl committed
    Motivation
    ----------
    When a WRITE_QUEUED operation is redistributed, it needs to be readded
    but not cloned (since its still in a sendable state).
    
    Modification
    ------------
    Return after adding the operation again.
    
    Result
    ------
    The operation is readded and not cloned afterwards too.
    
    Change-Id: I79fec436aa538a8a4074e82f69b3ed186c5126b7
    Reviewed-on: http://review.couchbase.org/36258
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-167: Avoid deadlock on notify listeners.

    daschl authored daschl committed
    Motivation
    ----------
    Because of how the addListener and notifyListener works, it could be that
    one deadlocks each other because they are waiting on the same locks from
    different threads.
    
    Modifications
    -------------
    The listeners are copied before notified, moving it out of the synch block.
    
    Result
    ------
    Since notify is not synched anymore, the lock should be not happening anymore.
    
    Note that also the listeners array is set to empty which avoid notifying listeners
    more than once potentially.
    
    Thanks to @adamhonen for pointing out the fix.
    
    Change-Id: I7ebda58c2eadd62d8885e3eeac79d5a971e07979
    Reviewed-on: http://review.couchbase.org/36219
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  4. @daschl

    SPY-168: isJSONObject should handle null or empty input values.

    daschl authored daschl committed
    Motivation
    ----------
    Before this change, the isJSONObject was suspect to NPEs and possibly also
    regex match failings on empty strings, although that does not seem to be the
    case on Java 1.7+.
    
    Modifications
    -------------
    Specific null and empty checks have been added to make the method more robust.
    
    Result
    ------
    NPEs are not raised anymore and also empty strings are checked much quicker. Test
    cases have been added to verify functionality.
    
    Side note: An exception like this was reported on empty strings, but could not be
    verified with Java 1.7 onward. It is suspected that this changeset also fixes
    the issue given the input type and code process:
    
    Original Exception: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    Stack trace:
    java.lang.String.charAt(String.java:658)
    java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3715)
    java.util.regex.Pattern$Ques.match(Pattern.java:4079)
    java.util.regex.Pattern$Begin.match(Pattern.java:3472)
    java.util.regex.Matcher.match(Matcher.java:1221)
    java.util.regex.Matcher.matches(Matcher.java:559)
    net.spy.memcached.util.StringUtils.isJsonObject(StringUtils.java:109)
    net.spy.memcached.transcoders.SerializingTranscoder.encode(Seriali
    ...
    
    Change-Id: Icaca2f3fef658cdb2c376b6b4dba12ae0327f240
    Reviewed-on: http://review.couchbase.org/36695
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  5. @daschl

    SPY-164: Clone gets correctly.

    daschl authored daschl committed
    Motivation
    ----------
    When a gets operation is cloned, it currently gets incorrectly cloned into
    a regular get operation. This can cause issues later on.
    
    Modifications
    -------------
    Make sure that a gets() gets correctly cloned into a new gets().
    
    Result
    ------
    The cloning is now properly done, based on the operation type.
    
    Thanks to Brad Svee (@sveesible) for the fix suggestion.
    
    Change-Id: I7b8820bea20d0a0d9555f1bb9b2a46e5327a5f78
    Reviewed-on: http://review.couchbase.org/36221
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Apr 23, 2014
  1. @daschl

    SPY-163: Count down bulk get latch even when empty key list is provided.

    daschl authored daschl committed
    Motivation
    ----------
    When a empty iterator (or empty key list) is passed in to a get bulk operation,
    a result is never returned and the thread is blocked because it waits on a
    latch that will never be counted down (because no response will ever arrive).
    
    Modifications
    -------------
    If no chunks with keys are sent out to the servers, the latch is initialized
    to 0 right away so that the code doesn't need to wait at all.
    
    Result
    ------
    The code now returns properly with an empty map instead of blocking the thread
    forever.
    
    Change-Id: I0711c399d9f15010bc808e0f651ce6ad605c06f0
    Reviewed-on: http://review.couchbase.org/36208
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Apr 14, 2014
  1. @daschl

    SPY-162: Also respect nagle setting on reconnect.

    daschl authored daschl committed
    Motivation
    ----------
    If a server connection is reset (because it is lost or a reconnection
    is triggered), the nagle setting is not re-set properly.
    
    Modifications
    -------------
    During the reconnect phase, properly re-set the nagle setting so it is
    respected on the new connection.
    
    Result
    ------
    The custom nagle setting is respected and used even across new connections.
    
    Change-Id: Ic0b513b8538a39710aaf8fd0f0f699a5c561bc09
    Reviewed-on: http://review.couchbase.org/35553
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  2. @daschl

    Enhanced auth logging on sasl failure.

    daschl authored daschl committed
    Motivation:
    -----------
    In case of long-taking auth roundtrips, it could be the case - for one 
    reason or another - that a empty sasl list gets returned or the auth 
    thread gets interrupted, leading to the same effect. This needs to 
    be better debugable from the logs.
    
    Modifications:
    --------------
    Better logging has been added for auth failure scenarios, and also the 
    sasl mechs response has been refactored a bit so that the timing is 
    also reported in case of an error.
    
    Result:
    -------
    Auth errors are now easier to debug from the logs.
    
    Change-Id: I9f0fff8b2c3a6b1492fb0fd82746ff78f7b006c5
    Reviewed-on: http://review.couchbase.org/35672
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Apr 4, 2014
  1. @daschl

    SPY-161: Cascade op cancellations.

    daschl authored daschl committed
    Motivation
    ----------
    When an operation is redistributed (be it because of reconnects
    and/or "not my vbucket" responses, it gets cloned. The problem
    is that the initial callback always points to the original
    operation, not the cloned one. While the clone gets the callback,
    the other way round (like cancelling from user-code) will never
    trickle through to the cloned ops.
    
    Modifications
    -------------
    In order to fix this issue, code has been added which connects
    the original op with the cloned ones, by keeping a list of
    cloned operations in the original op. To prevent overly long
    stack in malicious scenarios, an overall clone-cap of 100
    clones is introduced. If this cap is reached, the operation
    will not be cloned further but cancelled.
    
    Result
    ------
    With this modifications, timeouts and cancellations from user code
    will trickle through to the clone operations, prevent issues when
    cloned operations are around "forever".
    
    Change-Id: I304534a62202b705d78ca5f775f47afcd6be238a
    Reviewed-on: http://review.couchbase.org/34883
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Mar 27, 2014
  1. @daschl

    SPY-160: Avoid ConcurrentModificationException with the retry queue

    daschl authored daschl committed
    Motivation
    ----------
    ConcurrentModificationException will show up since the code can recursively
    modify itself.
    
    Modifications
    -------------
    Copy the original list into a temporary new one to avoid the exception.
    
    Result
    ------
    Redistribute on the retry list will work as expected, without an
    exception.
    
    Change-Id: Ieff1a87136bef38280b7f139192419073d6a878a
    Reviewed-on: http://review.couchbase.org/34977
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  2. @daschl

    Add development pom.xml

    daschl authored daschl committed
    Motivation
    ----------
    While ivy/ant works for years now, it is a little too hard to get
    started when contributing simple patches with IDE setup. Since most
    IDEs have good maven support, adding a pom.xml to get up and running
    quickly makes it easier to contribute and develop.
    
    Modification
    ------------
    Add a pom.xml which is inteded to get up and running quickly. It is not
    designed to do release management, which still happens through the
    ant/ivy pipeline.
    
    Note that the test case fix is by intention, because otherwise the
    unit tests get messed up when ran through IntelliJ with the maven
    file imported.
    
    Result
    ------
    Contributors and developers can import the project more easily and
    contribute patches.
    
    Change-Id: I837eb73cb07560aef15301490eaab56e484be3a8
    Reviewed-on: http://review.couchbase.org/34845
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-160: Queue retry op instead of redistributing it immediately.

    daschl authored daschl committed
    Motivation
    ----------
    After making the original SPY-160 changes, the ops were correctly redistributed,
    but if the latch never gets counted down it gets recursively distributed and
    added. Example:
    
    	  at net.spy.memcached.protocol.TCPMemcachedNodeImpl.addOp(TCPMemcachedNodeImpl.java:344)
    	  at net.spy.memcached.MemcachedConnection.addOperation(MemcachedConnection.java:1206)
    	  at net.spy.memcached.MemcachedConnection.redistributeOperation(MemcachedConnection.java:994)
    	  at net.spy.memcached.protocol.TCPMemcachedNodeImpl.addOp(TCPMemcachedNodeImpl.java:350)
    	  at net.spy.memcached.MemcachedConnection.addOperation(MemcachedConnection.java:1206)
    	  at net.spy.memcached.MemcachedConnection.redistributeOperation(MemcachedConnection.java:994)
    	  at net.spy.memcached.protocol.TCPMemcachedNodeImpl.addOp(TCPMemcachedNodeImpl.java:350)
    	  at net.spy.memcached.MemcachedConnection.addOperation(MemcachedConnection.java:1206)
    	  at net.spy.memcached.MemcachedConnection.redistributeOperation(MemcachedConnection.java:994)
    
    Modifications
    -------------
    The changeset, instead of redistributing right now, adds the operation to the retry queue which means
    it will be handled eventually, but gives the IO thread a chance to run other tasks (including retreiving
    auth response information).
    
    Result
    ------
    The operation is queued and is not blocking the IO thread.
    
    Change-Id: I73a8e77255a54bceeb929febcadb0e555febdd67
    Reviewed-on: http://review.couchbase.org/34938
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  4. @daschl

    SPY-157: Fix auth logging times.

    daschl authored daschl committed
    Motivation
    ----------
    In the previous commit which added logging, it measured nanoseconds and printed
    milliseconds. This also screwed up the debug/warn metric.
    
    Modifications
    -------------
    Correctly convert nanoseconds to milliseconds.
    
    Result
    ------
    Timings are now properly warned and formatted.
    
    Change-Id: Id174a49e03e052f9e32c98cc32aa7ad0b82bbb4d
    Reviewed-on: http://review.couchbase.org/34936
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Mar 26, 2014
  1. @daschl

    SPY-156: Expose more async mutate methods.

    daschl authored daschl committed
    Motivation
    ----------
    More flexible incr/decr methods are exposed as sync variants than
    with their async counterparts. This patch is an effort to bring them
    on par (almost) completely.
    
    Modifications
    -------------
    More async variants have been exposed, which were already supported
    through the private asyncMutate method. Note that since the ascii
    protocol doesn't support defaults and expiration for incr/decr, those
    return an UnsupportedOperationException, because it is nontrivial to
    fix. Please refer to the sync variants if you need that.
    
    Result
    ------
    When the binary protocol is used, much more asyncIncr/asyncDecr methods
    are exposed, explicitly helping with default values and expiration.
    
    Change-Id: I4403b14d6146afb325afa9c239da28b55e89e935
    Reviewed-on: http://review.couchbase.org/34257
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  2. @daschl

    SPY-160: Redistribute ops when waiting for authentication to complete.

    daschl authored daschl committed
    Motivation
    ----------
    When an operation gets added and the node needs to (re)connect, it waits
    for a given amount of time (authWaitTime). If the auth does not complete
    in the period of time, the operation is cancelled. This is suboptimal,
    especially if the operation is not timed out yet, it could wait longer
    until it gets timed out/cancelled.
    
    Modifications
    -------------
    This changeset makes sure that an operation gets redistributed (assuming
    FailureMode is NOT cancel) if the authLatch is not counted down in the
    wait period.
    
    Redistributing will only happen (further down the code stack) if the
    op is 1) not cancelled and 2) not timed out already.
    
    Result
    ------
    Still valid operations will be transparently rescheduled until they
    either go through validly or will eventually time out or get
    cancelled.
    
    Change-Id: I6f849314e11435a6ebc69a4bfc1eab705df850e8
    Reviewed-on: http://review.couchbase.org/34852
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-157: Add Auth logging.

    daschl authored daschl committed
    Motivation
    ----------
    Debugging how long authentication steps take is currently not
    possible. Proper logging needs to be added in order to debug
    authentication timeframes.
    
    Modifications
    -------------
    Added logging infrastructure for the individual steps (list sasl
    mechs, and challenge/response cycles), as well as a total amount
    on a per-node basis.
    
    If an individual step takes over 250ms it is WARNed instead of
    DEBUGed, and if the total auth step takes over 1 second it it also
    WARNed. Note that while these timings are fixed values, in general
    the operation taking this long points to something wrong since it
    is expected to take in the 1ms range.
    
    Result
    ------
    Auth times can now be observed both in development and production,
    better pointing to possible issues.
    
    Change-Id: I3deab53332251263c5a6dcf3e2bfd75538dfb24c
    Reviewed-on: http://review.couchbase.org/34849
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  4. @daschl

    SPY-159: Make the auth latch timeout configurable.

    daschl authored daschl committed
    Motivation
    ----------
    Currently, the auth latch timeout is fixed to one second and not changeable.
    In certain scenarios (for example with CRAM-MD5 where more roundtrips need
    to be issued), this is too short. Making it configurable allows to adjust the
    setting to latencies in target environments.
    
    Modification
    ------------
    Expose a "authWaitTime" setting in the factory and the builder to allow set
    the value in milliseconds. It still defaults to one second for backwards
    compatibility.
    
    Result
    ------
    The auth timeout can be modified as needed in production deployments.
    
    Change-Id: Id06f4ede00402688c00a283bcff82cde25a7a205
    Reviewed-on: http://review.couchbase.org/34846
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Commits on Mar 20, 2014
  1. @daschl

    SPY-158: Use Milliseconds instead of Seconds for "max reconnect" delay.

    daschl authored daschl committed
    Motivation
    ----------
    Currently, when a reconnection needs to happen against a node, a incremental
    delay for subsequent reconnect tries is selected. Because of the wrong time
    format used (seconds instead of milliseconds), the delay is always capped
    at 30ms, leading to immediate reconnects with no backoff effect.
    
    Modifications
    -------------
    For backwards compatibility, the "second" time unit is kept in the factory,
    and instead in the MemcachedConnection the time is converted to milliseconds.
    
    Result
    ------
    A proper reconnect delay going from 2^0 seconds up to 2^4 seconds, peaking at
    30 seconds by default (as always changeable through the factory)
    
    This changeset makes sure that
    
    Change-Id: I4a348f50e41451a6542b4b0263b915990730c3f8
    Reviewed-on: http://review.couchbase.org/34728
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Mar 6, 2014
  1. @daschl

    SPY-154: Also RETRY on binary NMVB response with bulk gets.

    daschl authored daschl committed
    This changeset makes sure that even when one of the individual get
    operations in the bulk request fails with a "Not My VBucket", the
    single get operation gets retried.
    
    To make this work, the underlying bulk operation is changed slightly
    to be notified that it has to wait for N more operations before
    notifying the listeners and counting down the latch.
    
    Change-Id: I6413233a3d0289ab728312f8f4edab5df96a0081
    Reviewed-on: http://review.couchbase.org/33700
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
  2. @daschl

    SPY-127: Optimize StringUtils performance.

    daschl authored daschl committed
    This changeset optimizes the individual StringUtils methods, especially
    the isJsonObject method. Before, if no proper JSON was detected, a final
    check against an Integer was performed. If no integer was found, a very
    expensive exception was thrown, killing performance.
    
    This check has been replaced with a faster regex. Also, other parts
    of the methods have been refactored to be more performant.
    
    Change-Id: I7616d2b042896aa76d73d536a3dde1c998990d9b
    Reviewed-on: http://review.couchbase.org/34184
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Feb 25, 2014
  1. @daschl

    SPY-153: Adding a typesafe StatusCode for OperationStatus instances.

    daschl authored daschl committed
    This makes it possible to add easier checks on futures, while not
    having to rely on string matching in the status message. This is
    an addition, so old behavior will not be changed, its just more
    convenient and can be better documented (it does not directly rely
    on a server response).
    
    Change-Id: Ie416e317d5fd21af2c3efb177b08b68dd8c45639
    Reviewed-on: http://review.couchbase.org/33405
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  2. @daschl

    Add support for replica get with CAS (ReplicaGets).

    daschl authored daschl committed
    This changeset adds the underlying operations and clone-logic for
    replica get operations including the underlying CAS value.
    This can be utilized by the upper layers to provide responses that
    not only include the raw value from a replica, but also their
    corresponding CAS value.
    Change-Id: Ib218669b6bbc84f3111e107e14761a03ed2f9728
    Reviewed-on: http://review.couchbase.org/33799
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
  3. @daschl

    SPY-155: Synchronize when future listeners are notified.

    daschl authored daschl committed
    This changeset prohibits a possible race condition when listeners
    are called from the callback. Proper sync has been in place for
    both adding and removing, but not for notifying.
    
    Change-Id: I4cfa0036c2b7b89985b0026c5da5dca26cc9fe52
    Reviewed-on: http://review.couchbase.org/33800
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Commits on Feb 14, 2014
  1. @deeptida @daschl

    Changes for the New feature test for credential encryption CRAM-MD5 o…

    deeptida authored daschl committed
    …r PLAIN
    
    Change-Id: Ic777b04e87670f0a9d967b4a439fea205b129e97
    Reviewed-on: http://review.couchbase.org/32588
    Reviewed-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
    Tested-by: Deepti Dawar <deepti.dawar@globallogic.com>
Commits on Feb 3, 2014
  1. @daschl

    SPY-148: Do not rename the worker thread for listeners.

    daschl authored daschl committed
    It's more explicit if the naming of the threads is left to the
    executor service (through custom thread factory).
    
    Change-Id: I7457d036b70ba6dd30d6d99dd9d8cbcbaa0cf3dd
    Reviewed-on: http://review.couchbase.org/31715
    Reviewed-by: Matt Ingenthron <matt@couchbase.com>
    Tested-by: Michael Nitschinger <michael.nitschinger@couchbase.com>
Something went wrong with that request. Please try again.