Skip to content

logkit throws out error if redis_datatype is channel #1149

@soulmachine

Description

@soulmachine

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions