-
Notifications
You must be signed in to change notification settings - Fork 374
Description
Describe the bug
I have a service that needs to access a redis cluster. I started development with placing the service and cluster in the same Docker container and it worked without a problem. Unfortunately when I tried to place both the service and cluster in separate containers the cluster client is unable to create a subscriber. The subscriber() method call on RedisCluster fails with a following stacktrace:
#0 0x00007f7e7e97c672 in __cxa_throw () from /lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x00007f7e7eaedd4f in sw::redis::throw_error(redisContext const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) [clone .cold] () from /usr/local/lib/libredis++.so.1
#2 0x00007f7e7eafdc4f in sw::redis::Connection::Connector::connect() const () from /usr/local/lib/libredis++.so.1
#3 0x00007f7e7eaff0c4 in sw::redis::Connection::Connection(sw::redis::ConnectionOptions const&) () from /usr/local/lib/libredis++.so.1
#4 0x00007f7e7eb19034 in sw::redis::RedisCluster::subscriber() () from /usr/local/lib/libredis++.so.1
#5 0x0000555eaa058a9a in main (argc=1, argv=0x7fffdf5c40f8) at ../test.cpp:9
To Reproduce
I have provided a minimal example in this repository:
https://github.com/KonradPR/redis-example
It contains a simple docker compose that runs the minimal setup capable of the bug reproduction.
Expected behavior
I expected to create a Subscriber object without a problem.
Environment:
- OS: [Ubuntu 20.04.4 LTS]
- Docker version: [20.10.7]
- Compose version: [1.29.2]
- hiredis version: [master, commit d7683f35aa66e222aad07caf5b345393d0c1b9f1 ]
- redis-plus-plus version: [master, commit 463f341]
Additional context
I would be thankful for any sugestions or directions as to what can be the source of the problem.
Best Regards,
Konrad