Link

Jedis Client ClassCastException
对应风险代码段:

   private  T executeAction(ShardedJedisAction action) {
        SmartShardedJedisPool pool = this.getSmartShardedJedisPool();
        pool = this.checkPressurePool(pool);
        ShardedJedis shardedJedis = null;

        Object var5;
        try {
            shardedJedis = (ShardedJedis)pool.getResource();
            Object var4 = action.doAction(shardedJedis);
            return var4;
        } catch (DiscardShardException var18) {
            var5 = null;
        } catch (JedisConnectionException var19) {
            if (shardedJedis != null) {
                try {
                    //TODO ?
                    pool.returnBrokenResource(shardedJedis);
                } catch (Exception var17) {
                    logger.warn("Can not return broken resource.", var17);
                }

                shardedJedis = null;
            }

            throw var19;
        } finally {
            if (shardedJedis != null) {
                try {
                    pool.returnResource(shardedJedis);
                } catch (Exception var16) {
                    logger.warn("Can not return resource.", var16);
                }
            }

        }

        return var5;
    }

你可能感兴趣的:(Link)