Git Product home page Git Product logo

redis-client-test's Introduction

Redis client test

A couple of simple testprograms that uses some existing Redis client libraries in C. Each folder covers a single client library, and CMake is used to download needed libraries and to build the test programs.

Prepare:

# Install: cmake, gcc/clang (valgrind)

# Needed for async behaviour
sudo apt install libevent-dev

# Start Redis clusters/instances
make start

(use `make stop` to stop them again later)

hiredis

Simple usage of the official library.

Build

cd hiredis/
mkdir build
cd build
cmake ..
make

hiredis-vip

Simple usage of the library supporting Redis Cluster This library is built on top of an older hiredis.

Build

cd hiredis-vip/
mkdir build
cd build
cmake ..
make

Findings

Problems found in the hiredis-vip:

  • Not supporting IPv6 int redisClusterSetOptionAddNode(redisClusterContext *cc, const char *addr) Using : to split address and port, wont work in IPv6

hiredis-vip (heronr fork)

Simple usage of the library supporting Redis Cluster. This library links to an official hiredis.

Build

cd hiredis-vip-heronr/
mkdir build
cd build
cmake ..
make

Findings

Problems found in the hiredis-vip heronr fork:

  • Not supporting IPv6 int redisClusterSetOptionAddNode(redisClusterContext *cc, const char *addr) Using : to split address and port, wont work in IPv6

  • Include path errors: sed -i s/adapaters/adapters/ ${CMAKE_BINARY_DIR}/src/hiredis_vip_external/adapters/libevent.h

  • Spelling: witch static cluster_node *node_get_witch_connected(redisClusterContext *cc)

  • Leak: Iterator not released void redisClusterAsyncDisconnect(redisClusterAsyncContext *acc)

  • Faulty pointer static void unlinkAsyncContextAndNode(redisAsyncContext* ac) --> static void unlinkAsyncContextAndNode(void *data) node = (cluster_node *)(data);

  • Spelling

    • redisCLusterSendAll
    • redisCLusterClearAll
  • Unused functions

    • static void print_cluster_node_list(redisClusterContext *cc)
    • static cluster_node *node_get_by_slot(redisClusterContext *cc, uint32_t slot_num)

Checkers

docker run -t -v $(pwd):/src neszt/cppcheck-docker

redis-client-test's People

Contributors

bjosv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.