Comments (5)
Please let me know if I can provide any further information which will help me understand why I'm seeing this problem. Currently, I'm having to restart each app server multiple times a day.
from jredis.
Hi Jabley,
First thought was that the client and server were mismatched. But looks like a concurrent use of the connection. In general, unless you have client/server version mismatch, that sort of un-expected token in the response is generally due to 2 or more thread using a non-threadsafe connector.
-
Try using a pipeline connection instead.
-
Alternatively, see what happens if you comment out "connectionSpec.isReliable(true);"
from jredis.
Just to be explicit: the JRedisAsyncClient reference is being used as a shared resource across all request threads in my webapp, with no external mutex acting as a barrier. Is that a safe way of using it?
I'm going to switch this to using a pipeline connection instead and see what happens, as you suggest.
from jredis.
So my understanding of your suggestion is to change the JRedisFuture implementation that I am using; i.e. from
redis = new JRedisAsynchClient(connectionSpec);
to
redis = new JRedisPipeline(connectionSpec);
I haven't found any documentation showing how to use this class (wiki / Javadoc). Are you familiar with the JSR-305 or JCIP annotations regarding thread-safety? I've found them useful from a documentation perspective at least.
I'll make the above change to my code and try to test. Unfortunately, I'm not able to reliably reproduce the problem, so I'll just have to see if the current situation improves at all.
Cheers,
James
from jredis.
Its not thread safe.
Semantics are defined: JRedsAsynch interface. Its identical to any implementation of JRedisAsynch.
Its trivial to reproduce the problem: the heartbeat is sending PING and expecing +Pong. That's a status response. Just simply do a tight loop with INCR (expecting a number response) and you'll get your exception.
from jredis.
Related Issues (20)
- Expecting status code for size/count HOT 1
- Infinitive loop on reconnect (disconnect errors) HOT 3
- Connection re-established but last request not processed HOT 1
- add support for pub/sub
- full binary support HOT 11
- add support for hashes HOT 2
- add support for 2.2 (new unified request protocol) HOT 1
- invalid pom.xml configuration HOT 2
- pooling support & logging
- missing redis operations
- Build Failure HOT 2
- jreids ZINTERSTORE , ZUNIONSTORE wrong result HOT 2
- Occasional exception: org.jredis.connector.ConnectionReset: Connection re-established but last request not processed: in.read returned -1 HOT 10
- JRedis: specifying encoding for String opterations HOT 1
- can't call "sadd" sequentially HOT 1
- JRedisClient-tests error HOT 2
- Runtime Exception HOT 1
- ERR Protocol error: expected '$' got '*' on mset HOT 2
- Add support for time command
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 jredis.