标签:alt jedis view rac spool reads img dead normal
Background: I start a thread [call thread A below]in Spark driver to handle opening files in codis, in which I start six thread [call sub threads below]to handle the files in parallel.
What happened:
I found the codis openingFilePool never update since a given time.
So I looked into the Thread Dump
tools of spark, and saw that thread A is always been WAITING. As below:
The normal one is as follow:
It seems there is a deadlock?
Thread A get a jedis instance from JedisResourcePool to get all opening files.
Then, the sub threads handle these opening files and interact with codis in pipeline. [I use try(Pipeline pipeline = CodisPool.getPool().getResource().pipelined())]
try (Pipeline pipeline = CodisPool.getPool().getResource().pipelined())
I am not sure whether this code will close jedis and pipeline, or it will just close pipeline?
JedisResourcePool is not thread-safe?
Some says that we should sync when we getResource() from JedisResourcePool. I am not sure.
And also I think should I configure the number of Jedis pool.
标签:alt jedis view rac spool reads img dead normal
原文地址:http://www.cnblogs.com/wttttt/p/7202500.html