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

logkit throws out error if redis_datatype is channel #1149

Open
soulmachine opened this issue Mar 25, 2021 · 1 comment · May be fixed by #1150
Open

logkit throws out error if redis_datatype is channel #1149

soulmachine opened this issue Mar 25, 2021 · 1 comment · May be fixed by #1150

Comments

@soulmachine
Copy link

soulmachine commented Mar 25, 2021

Bug Report

Redis reader fails to start if redis_datatype is channel

logkit 相关配置:

"reader":{
        "mode":"redis",
    	"redis_datatype":"channel",
        "redis_key":"mykey",
        "redis_address":"localhost:6379"
   }

运行环境:

macOS

logkit 版本:

v1.5.5

操作系统版本:

macOS Big Sur 11.2.1

复现过程操作步骤:

  1. 启动一个 redis server
  2. 新开一个terminal, 启动 redis-cli, 敲 SUBSCRIBE mykey,这样订阅一个channel
  3. 新开 redis-cli, 命令PUBSUB CHANNELS 可以看到mykey, 但是type mykey返回none。可见 redis 在 channel即使存在的情况下,也会返回none, 这是问题的根源
  4. 写一个配置文件,redis_datatype 设置为 channel
  5. 启动 logkit, ./logkit -f logkit.conf

预期表现:

正常启动,顺利从 Redis channel 读取到数据

实际情况:

抛出了异常:

[ERROR][github.com/qiniu/logkit/mgr] mgr.go:380: NewRunner(redis_reader) failed: key[mykey]'s type expect as channel,actual get none
@soulmachine
Copy link
Author

soulmachine commented Mar 25, 2021

其次,Redis 服务器刚启动,里面是空的,没有任何数据的时候,redis reader 妥妥的不能启动,因为这时候任何key都不存在, type key_name会返回none

@soulmachine soulmachine linked a pull request Mar 25, 2021 that will close this issue
2 tasks
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

Successfully merging a pull request may close this issue.

1 participant