Repository navigation
Conversation
added 2 commits
October 26, 2026 13:09
When the mutate latch times out, call op.timeOut() so an op still in the write queue is dropped instead of being applied later, and feed MemcachedConnection.opTimedOut so the node's continuous-timeout counter counts it. The timer is tagged ipc.status=timeout with the failed host. When the node answers (any status except timed out or cancelled), call MemcachedConnection.opSucceeded so the counter stays consecutive on clients that mostly incr/decr. The latch result decides the outcome, so a reply racing in after the deadline cannot flip it. The status holder is now an AtomicReference because op.timeOut() runs the callback on the caller thread.
- main: use BaseOperationImpl.TIMED_OUT instead of a private duplicate, move the "latch decides" comment next to the status it explains, and null-guard the handling node when building the evc.failed.host tag - tests: rewrite the unsent-op test so it fails without op.timeOut() (node operation timeout 60 s, assert the server saw only the second mutate) - tests: add late-reply-races-the-timeout, first-status-wins and no-handling-node tests - tests: rename the NF test, fix the TestConnectionFactory javadoc, drop a redundant null check, import SocketAddress and ArrayBlockingQueue, and give the canceller test a 2 s mutate timeout
This branch has not been deployed
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.
What
Changes to
EVCacheMemcachedClient.mutate(incr/decr):op.timeOut()andMemcachedConnection.opTimedOut(op), then returns -1. Theipc.client.calltimer is taggedipc.result=failure,ipc.status=timeoutandevc.failed.host.MemcachedConnection.opSucceeded(op).Why
ipc.statusoripc.resulttag, so mutate timeouts don't show up in metrics.op.timeOut()makes the IO thread drop it.The latch alone decides whether the mutate timed out, so a reply that arrives after the deadline can't change the result. The status holder is now an
AtomicReference, becauseop.timeOut()runs the callback on the caller thread while the IO thread may run it too.Testing
EVCacheMemcachedClientMutateTesthas 6 tests and is added totest-suite.xml. It runs a real client against a fake memcached on 127.0.0.1 and covers: