Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jetcache(RedisLettuceCache) GET error #886

Open
Skqing opened this issue May 14, 2024 · 3 comments
Open

jetcache(RedisLettuceCache) GET error #886

Skqing opened this issue May 14, 2024 · 3 comments

Comments

@Skqing
Copy link

Skqing commented May 14, 2024

版本

image

配置

jetcache:
  statIntervalMinutes: 30
  areaInCacheName: false
  local:
    default:
      type: linkedhashmap
      keyConvertor: fastjson2
      limit: 500
  remote:
    default:
      type: redis.lettuce
      keyConvertor: fastjson2
      valueEncoder: java
      valueDecoder: java
      mode: cluster
      uri:
       - redis://172.18.0.80:6379
       - redis://172.18.0.81:6380
       - redis://172.18.0.82:6381

代码

暂无法定位,本来想根据异常日志进行定位,但jecache的异常只有一句话,没有更详细的信息,关键是打印出的key是转换后的,无法确定是操作哪个key导致的。

异常

2024-05-14 11:05:18.407 [lettuce-epollEventLoop-4-2] ERROR [com.alicp.jetcache.support.SquashedLogger.error: 54] - jetcache(RedisLettuceCache) GET error. key=[32754987]
2024-05-14 11:05:18.412 [lettuce-epollEventLoop-4-1] ERROR [com.alicp.jetcache.support.SquashedLogger.error: 71] - jetcache(RedisLettuceCache) GET error. key=[33536723] 
2024-05-14 11:05:21.415 [lettuce-epollEventLoop-4-2] ERROR [com.alicp.jetcache.support.SquashedLogger.error: 71] - jetcache(RedisLettuceCache) GET error. key=[80005466]

获取部分缓存时报错,但这个报错的key跟实际的key不一样,找不到对应的key。
相同项目中,并非所有获取都会报错。
这个key能不能打印设置的key?这样好找到问题。
put("test")
打印的时候希望能打印的是"test,而不是数字

image

    protected void logError(String oper, Object key, Throwable e) {
        StringBuilder sb = new StringBuilder(256);
        sb.append("jetcache(")
                .append(this.getClass().getSimpleName()).append(") ")
                .append(oper)
                .append(" error.");
        if (!(key instanceof byte[])) {
            try {
                sb.append(" key=[")
                        .append(config().getKeyConvertor().apply((K) key))
                        .append(']');
            } catch (Exception ex) {
                // ignore
            }
        }
        SquashedLogger.getLogger(logger).error(sb, e);
    }
@areyouok
Copy link
Collaborator

打印出来的key是用keyconvertor处理过的,说明就是一串数字。SquashedLogger每10秒会输出一次错误信息,你可以找找看。

看来SquashedLogger做的还不太实用。

@Skqing
Copy link
Author

Skqing commented May 15, 2024

打印出来的key是用keyconvertor处理过的,说明就是一串数字。SquashedLogger每10秒会输出一次错误信息,你可以找找看。

看来SquashedLogger做的还不太实用。

在阿里云Redis管理后台搜这个打印的key是搜不出来的,所有很奇怪,到底是打印的key是不对的,还是其他地方除了问题,我在查查看吧。

@Skqing
Copy link
Author

Skqing commented May 21, 2024

打印出来的key是用keyconvertor处理过的,说明就是一串数字。SquashedLogger每10秒会输出一次错误信息,你可以找找看。

看来SquashedLogger做的还不太实用。

能不能把这个异常抛出来,这样我们能捕获异常并且处理,现在这个日志都不知道异常发生在哪里,生产上又很难去调试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants