Skip to content

[Bug] org.redisson.Redisson.getBucket(String,Codec) error #603

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

Open
2 tasks done
wangquanchn opened this issue Mar 25, 2025 · 0 comments
Open
2 tasks done

[Bug] org.redisson.Redisson.getBucket(String,Codec) error #603

wangquanchn opened this issue Mar 25, 2025 · 0 comments
Labels
bug 🐞 Something isn't working

Comments

@wangquanchn
Copy link
Contributor

Search before asking

  • I have searched the existing issues before asking.

AREX Test Service

AREX Java Agent (arextest/arex-agent-java)

Current Behavior

应用接上 arex-agent.jar,进行流量录制。
当请求中触发 getBucket(String name, Codec codec) API,且 Codec 不是 org.redisson.codec.Kryo5Codec,则程序报错。

public final class Redisson implements RedissonClient {
    @Override
    public <V> RBucket<V> getBucket(String name, Codec codec) {
        return new RedissonBucket<>(codec, commandExecutor, name);
    }
}

报错信息:

2025-03-25 19:50:03.032 ERROR 84232 --- [isson-netty-1-2] o.r.client.handler.CommandDecoder        : Unable to decode data. channel: [id: 0x9d92dcdb, L:/127.0.0.1:62119 - R:127.0.0.1/127.0.0.1:6379], reply: ReplayingDecoderByteBuf(ridx=97, widx=97), command: (GET), params: [GetBucketKey], promise: java.util.concurrent.CompletableFuture@32e76ba1[Not completed, 1 dependents]

com.esotericsoftware.kryo.KryoException: Encountered unregistered class ID: 89
	at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:159) ~[kryo-5.6.0.jar:na]
	at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:758) ~[kryo-5.6.0.jar:na]
	at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:869) ~[kryo-5.6.0.jar:na]
	at org.redisson.codec.Kryo5Codec$4.decode(Kryo5Codec.java:181) ~[redisson-3.36.0.jar:3.36.0]
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:444) [redisson-3.36.0.jar:3.36.0]
	at org.redisson.client.handler.CommandDecoder.decodeCommand(CommandDecoder.java:220) [redisson-3.36.0.jar:3.36.0]
	at org.redisson.client.handler.CommandDecoder.decode(CommandDecoder.java:148) [redisson-3.36.0.jar:3.36.0]

Expected Behavior

不报错,正常获得 redis 中的数据。

Steps To Reproduce

  1. 本地启动一个 redis 服务
    docker pull redis:6.2.17
    docker run --name my_redis -p 6379:6379 -d redis:6.2.17

  2. 拉取复现代码
    git clone https://github.com/wangquanchn/arex_redisson_error_case.git
    进入目录
    cd arex_redisson_error_case

  3. 正常 case
    3.1 启动应用
    mvn spring-boot:run
    3.2 设置 redis 数据,程序正常返回
    curl --location 'http://127.0.0.1:8080/redisson/setBucket'
    3.3 查询 redis 数据,程序正常返回
    curl --location 'http://127.0.0.1:8080/redisson/getBucket'
    3.4 Ctri + C 停止应用

  4. 报错 case
    4.1 接入 arex agent,重新启动应用,注意这里替换 ${path} 和 ${your_storage_host}
    mvn spring-boot:run -Dspring-boot.run.jvmArguments="-javaagent:/${path}/arex-agent.0.4.8.jar -Darex.service.name=arex.agent.test -Darex.storage.service.host=${your_storage_host}"
    4.2 查询 redis 数据,发生报错
    curl --location 'http://127.0.0.1:8080/redisson/getBucket'

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant