Comments (15)
I will look into it, thanks.
from xmemcached.
I've fixed this issue, it happens in failure mode, the new release will be delivered ASAP.
from xmemcached.
Is there any progress on this issue?
from xmemcached.
I am sorry , i didn't have too much time on this project in these days, but i will try to look into it this weekend.
from xmemcached.
Released 2.4.2, it may takes sometime to be synced into maven central repo.
https://github.com/killme2008/xmemcached/releases/tag/xmemcached-2.4.2
from xmemcached.
I am not convinced this is fixed. I just tried out version 2.4.2 both with failureMode=true
and failureMode=false
and when I change the DNS record of the server to point to a different IP and then restart the old server (52.57.227.183) the client will not connect to the new server (52.59.110.98). Here is the log output:
252885 [Xmemcached-Reactor-2] ERROR net.rubyeye.xmemcached.impl.MemcachedHandler - XMemcached network layout exception
java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:197)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:382)
at com.google.code.yanf4j.nio.impl.NioTCPSession.readFromBuffer(NioTCPSession.java:209)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onRead(AbstractNioSession.java:196)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:339)
at com.google.code.yanf4j.nio.impl.SocketChannelController.dispatchReadEvent(SocketChannelController.java:56)
at com.google.code.yanf4j.nio.impl.NioController.onRead(NioController.java:159)
at com.google.code.yanf4j.nio.impl.Reactor.dispatchEvent(Reactor.java:328)
at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:183)
252913 [Xmemcached-Reactor-2] INFO com.google.code.yanf4j.core.impl.AbstractController - Remove a session: 52.57.227.183:11211
Memcached error during get or set: There is no available connection at this moment
... (2 seconds later)
Memcached error during get or set: There is no available connection at this moment
254920 [Heal-Session-Thread] INFO com.google.code.yanf4j.core.impl.AbstractController - Trying to connect to 52.59.110.98:11211 for 1 times
254944 [Xmemcached-Reactor-0] INFO com.google.code.yanf4j.core.impl.AbstractController - Add a session: 52.59.110.98:11211
254945 [Xmemcached-Reactor-0] WARN com.google.code.yanf4j.core.impl.AbstractController - Memcached node mc3.c1.ec2.test62.memcachier.com/52.57.227.183:11211 is resolved into mc3.c1.ec2.test62.memcachier.com/52.59.110.98:11211.
255014 [Xmemcached-Reactor-3] ERROR net.rubyeye.xmemcached.impl.MemcachedHandler - XMemcached network layout exception
java.io.IOException: Connection reset by peer
at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:197)
at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:382)
at com.google.code.yanf4j.nio.impl.NioTCPSession.readFromBuffer(NioTCPSession.java:209)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onRead(AbstractNioSession.java:196)
at com.google.code.yanf4j.nio.impl.AbstractNioSession.onEvent(AbstractNioSession.java:339)
at com.google.code.yanf4j.nio.impl.SocketChannelController.dispatchReadEvent(SocketChannelController.java:56)
at com.google.code.yanf4j.nio.impl.NioController.onRead(NioController.java:159)
at com.google.code.yanf4j.nio.impl.Reactor.dispatchEvent(Reactor.java:328)
at com.google.code.yanf4j.nio.impl.Reactor.run(Reactor.java:183)
255015 [Xmemcached-Reactor-3] INFO com.google.code.yanf4j.core.impl.AbstractController - Remove a session: 52.59.110.98:11211
Note: I use the binary protocol with authentication. Could it be that XMemcached does not authenticate with the new server?
from xmemcached.
@saschat do you make sure the DNS changes take effect at your client machine? And JVM has DNS cache, you may have to disable it , see
https://stackoverflow.com/questions/1256556/any-way-to-make-java-honor-the-dns-caching-timeout-ttl
from xmemcached.
@killme2008 yes, the DNS changes take effect. See the log message I posted above. It removes the session with IP 52.57.227.183 and then adds a session with IP 52.59.110.98.
from xmemcached.
@saschat It looks that the client has resolved the server to new IP address and connect to it, but the connection was lost again. If you doubt it was an authentication problem, can you try it without the authentication?
from xmemcached.
That will be difficult. I work for MemCachier and we do not operate servers without authentication.
Note that it is not an authentication problem in the sense that the credentials do not work. If I restart the app it connects (and authenticates) to the new server. I think that maybe when XMemcached is trying to heal the session it does not authenticate or has a different problem regarding authentication.
The reason I say that is because when I connect to the server the first time I get a log message that it authenticated before it adds the session. Here is the log message for a normal operation:
284 [Thread-5] INFO net.rubyeye.xmemcached.auth.AuthTask - Authentication to mc1.c1.ec2.test62.memcachier.com/52.57.227.183:11211 successfully
284 [Xmemcached-Reactor-0] INFO com.google.code.yanf4j.core.impl.AbstractController - Add a session: 52.57.227.183:11211
But in the logs I posted earlier there is no message regarding authentication.
from xmemcached.
@saschat All right, i will try to reproduce it in my machine this weekend or later, but it may take sometime, i am really busy in these days, sorry.
from xmemcached.
@killme2008 Thanks!
I will also look into it and if I figure it out I will submit a PR.
from xmemcached.
@killme2008 I found the bug. I will try to find a good way to solve it and submit a PR.
from xmemcached.
@saschat Great! welcome to submit a PR.
from xmemcached.
This issue appears again due to a minor bug in initialization order ( see my pr) #129
from xmemcached.
Related Issues (20)
- does xmemcached support async? HOT 1
- XMemcached network layout exception: java.lang.OutOfMemoryError: Direct buffer memory HOT 1
- incrWithNoReply's behavior is not same with incr
- when one memcached node Dns Change to new IP then the HashAlgorithm.KETAMA_HASH always use the old IP to calc getSessionByKey
- Incr/Decr 方法能添加过期时间参数吗?
- Error on touch with mcrouter HOT 1
- Cannot cache data larer than 1MB HOT 2
- UnknownHostException when initialising HOT 2
- Again problems with server changing its ip address
- Deleting a non-existent key returns false. HOT 1
- Helm memcached deployment via bitnami chart with AWS ELB to headless services
- InetSocketAddressWrapper always request to resolve hostname HOT 1
- Spring dependency should be optional and not provided.
- Support kotlinx.serialization
- addServer() not blocking and causes uncaught exception with Healing enabled
- TimeoutException causes leakage of connections in several servers
- Is this repository is active and maintained HOT 8
- java.io.InvalidClassException: filter status: REJECTED with Java 17
- Authentication failure on CRAM-MD5
- Null pointer exception when doing multi key get
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmemcached.