Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Redis: Arbitrary panics when starting the broker #139

Description

@odacremolbap

I have seen 3 of these, no some of them informing TLS, some not.
The last relevant change I remember is upgrading go-redis from v9.0.0-rc2 to v9.0.2

2023/03/30 13:34:40 Applying default configuration
{"level":"info","ts":1680176080.2827864,"logger":"fswatch","caller":"fs/filewatcher.go:65","msg":"Adding file to watch","file":"/home/pablo/go/src/github.com/triggermesh/brokers/.local/broker-config.yaml"}
{"level":"info","ts":1680176080.2831702,"logger":"ingest","caller":"ingest/ingest.go:105","msg":"Ingest Server UpdateFromConfig ..."}
{"level":"info","ts":1680176080.2832122,"logger":"subs","caller":"subscriptions/manager.go:52","msg":"Updating subscriptions configuration"}
{"level":"info","ts":1680176080.2832682,"logger":"subs","caller":"subscriptions/manager.go:93","msg":"Creating new subscription from trigger configuration","name":"trigger1","trigger":{"filters":[{"exact":{"type":"example.type"}}],"target":{"url":"http://localhost:9099","deliveryOptions":{"retry":1,"backoffPolicy":"linear","backoffDelay":"PT5S"}}}}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x83f750]

goroutine 1 [running]:
github.com/redis/go-redis/v9/internal/pool.(*ConnPool).waitTurn(0xc0004e6000, {0x0, 0x0})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/internal/pool/pool.go:284 +0x30
github.com/redis/go-redis/v9/internal/pool.(*ConnPool).Get(0xc0004e6000, {0x0, 0x0})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/internal/pool/pool.go:245 +0x45
github.com/redis/go-redis/v9.(*baseClient)._getConn(0xc0004641e0, {0x0, 0x0})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:248 +0x38
github.com/redis/go-redis/v9.(*baseClient).getConn(0xc0004641e0, {0x0?, 0x0?})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:236 +0x69
github.com/redis/go-redis/v9.(*baseClient).withConn(0xc0004641e0, {0x0, 0x0}, 0xc0009ae388)
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:340 +0x54
github.com/redis/go-redis/v9.(*baseClient)._process(0xc0004641e0, {0x0, 0x0}, {0x1dbb828, 0xc00006ff80}, 0xc000100800?)
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:382 +0xe5
github.com/redis/go-redis/v9.(*baseClient).process(0xc0004641e0, {0x0, 0x0}, {0x1dbb828, 0xc00006ff80})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:364 +0x78
github.com/redis/go-redis/v9.(*hooksMixin).processHook(...)
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:173
github.com/redis/go-redis/v9.(*Client).Process(0xc0009ae4b0?, {0x0?, 0x0?}, {0x1dbb828?, 0xc00006ff80})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/redis.go:639 +0x43
github.com/redis/go-redis/v9.cmdable.XGroupCreateMkStream(0xc00052c360, {0x0?, 0x0}, {0xc0004ff100, 0x10}, {0xc000a81300, 0x10}, {0x1b06c79, 0x1})
        /home/pablo/go/pkg/mod/github.com/redis/go-redis/v9@v9.0.2/commands.go:1953 +0x1f3
github.com/triggermesh/brokers/pkg/backend/impl/redis.(*redis).Subscribe(0xc00031e0c0, {0xc000a812e0, 0x8}, 0xc0000f2be0)
        /home/pablo/go/src/github.com/triggermesh/brokers/pkg/backend/impl/redis/redis.go:208 +0x1ac
github.com/triggermesh/brokers/pkg/subscriptions.(*Manager).UpdateFromConfig(0xc0008282d0, 0xc00052cc30)
        /home/pablo/go/src/github.com/triggermesh/brokers/pkg/subscriptions/manager.go:99 +0x13b3
github.com/triggermesh/brokers/pkg/config/broker/watcher.(*Watcher).update(0xc000828730, {0xc0000fa600?, 0x4b?, 0xc000542060?})
        /home/pablo/go/src/github.com/triggermesh/brokers/pkg/config/broker/watcher/watcher.go:85 +0x346
github.com/triggermesh/brokers/pkg/config/broker/watcher.(*Watcher).Start(0xc000828730, {0x1db1c70, 0xc000146540})
        /home/pablo/go/src/github.com/triggermesh/brokers/pkg/config/broker/watcher/watcher.go:63 +0xb8
github.com/triggermesh/brokers/pkg/broker.(*Instance).Start(0xc00080c1c0, {0x1db1d18, 0xc0005175c0})
        /home/pablo/go/src/github.com/triggermesh/brokers/pkg/broker/broker.go:255 +0x7a6
github.com/triggermesh/brokers/cmd/redis-broker/cmd.(*StartCmd).Run(0xc0004e09a8, 0xc0004e08c0)
        /home/pablo/go/src/github.com/triggermesh/brokers/cmd/redis-broker/cmd/start.go:33 +0x1d5
reflect.Value.call({0x18c2a80?, 0xc0004e09a8?, 0x18?}, {0x1b077f7, 0x4}, {0xc000338180, 0x1, 0x0?})
        /usr/local/go/src/reflect/value.go:584 +0x8c5
reflect.Value.Call({0x18c2a80?, 0xc0004e09a8?, 0x18cf1a0?}, {0xc000338180?, 0x1825040?, 0xc0004e0a10?})
        /usr/local/go/src/reflect/value.go:368 +0xbc
github.com/alecthomas/kong.callMethod({0x1b072a3, 0x3}, {0x18f9460?, 0xc0004e09a8?, 0x3?}, {0x18c2a80?, 0xc0004e09a8?, 0x0?}, 0x0?)
        /home/pablo/go/pkg/mod/github.com/alecthomas/kong@v0.7.1/callbacks.go:95 +0x549
github.com/alecthomas/kong.(*Context).RunNode(0xc00036b500, 0xc0004f00f0, {0xc0009aff58, 0x1, 0x1})
        /home/pablo/go/pkg/mod/github.com/alecthomas/kong@v0.7.1/context.go:755 +0x5f7
github.com/alecthomas/kong.(*Context).Run(0xc0004e08c0?, {0xc0009aff58?, 0xc000793f48?, 0x9?})
        /home/pablo/go/pkg/mod/github.com/alecthomas/kong@v0.7.1/context.go:780 +0x14e
main.main()
        /home/pablo/go/src/github.com/triggermesh/brokers/cmd/redis-broker/main.go:48 +0x345
exit status 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions