profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/sewenew/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

sewenew/redis-plus-plus 598

Redis client written in C++

sewenew/redis-protobuf 104

Redis module for reading and writing Protobuf messages

sewenew/so 1

StackOverflow Q & A

sewenew/hiredis 0

Minimalistic C client for Redis >= 1.2

sewenew/moose 0

Multiphysics Object Oriented Simulation Environment

sewenew/redis-doc 0

Redis documentation source code for markdown and metadata files, conversion scripts, and so forth

sewenew/redis-geometry 0

Redis module for reading and writing geometry objects.

sewenew/sw-base 0

Base library for SeweneW's projects

sewenew/vector-engine 0

Vector Engine

issue commentsewenew/redis-plus-plus

Is the 'Redlock' mechanism supported in this library?

@wingunder Yes, I'll merge the master branch into recipes branch. I might do a merge this weekend.

Regards

wingunder

comment created time in 20 hours

issue commentsewenew/redis-plus-plus

Can not compile with REDIS_PLUS_PLUS_ASYNC_FUTURE

Thanks for the info!

what is the BOOST_THREAD_PROVIDES_EXECUTORS for?

BOOST_THREAD_PROVIDES_EXECUTORS is used for running the continuation, i.e. then clause, in a thread pool:

#include <sw/redis++/async_redis++.h>
#include <boost/thread/executors/basic_thread_pool.hpp>

boost::executors::basic_thread_pool pool(3);
auto fut = redis.get("key").then(pool,
        [](sw::redis::Future<sw::redis::Optional<std::string>> fut) {
            auto val = fut.get();
            if (val) cout << *val << endl;
        });

// Do other things

fut.get();

what it does and would the library work fine if i would not define it?

If you don't define it, and you don't need to use thread pool with continuation, it won't be a problem.

However, it seems that the boost 1.74 doesn't behave like older version. I'll do some research, and might remove this definition from async_utils.h.

Thanks again!

Regards

JindrichD

comment created time in 20 hours

issue commentsewenew/redis-plus-plus

Is the 'Redlock' mechanism supported in this library?

@inaryart I still don't receive any feedbacks on the API of this Redlock implementation. However, I'll merge mater branch to recipe branch from time to time. If you get any problem on it or have any feedback on it, feel free to let me know.

Regards

wingunder

comment created time in 2 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 Can you also try the debug branch of redis-plus-plus I mentioned in the above comments, and hiredis version 1.0.0 (not the hiredis I modified) with OpenSSL 3.0, and give me the output of error messages? So that I can do more debug, and maybe ask the hiredis community to fix it.

Thanks a lot!

Regards

dellorogiulio

comment created time in 2 days

issue commentsewenew/redis-plus-plus

specify "target" host with redis cluster

If you already has the IP and port info for a given node, you can create a Redis object instead of RedisCluster object.

Also, if you know the hash-tag of the node, you can use RedisCluster::redis(const StringView &hash_tag, bool new_connection = true) to create a connection to the node that contains the given hash tag.

Regards

Strafo

comment created time in 2 days

issue closedsewenew/redis-plus-plus

Disconnected

I connect redis in the running program. When I use it in the dynamic library, the connection is gone。I don't know if you have experienced it. Please help. Thank you!

closed time in 4 days

244916896

issue commentsewenew/redis-plus-plus

Disconnected

Since there’s no update. I’ll close this issue.

244916896

comment created time in 4 days

issue closedsewenew/redis-plus-plus

AsyncRedisCluster::rank or AsyncRedisCluster::zrank

Hi,it seems that there's a mistake about "zrank" command in the async redis cluster version, where we get the "rank" interface and the wrong "RANK" command sent to the redis server.

closed time in 4 days

Hanshanhu

issue closedsewenew/redis-plus-plus

Storing a vector of vectors of type int in a Redis cache

I would like to know how to store an std::vector<std::vector<int>> object.

closed time in 4 days

WilfredDube

push eventsewenew/vector-engine

sewenew

commit sha ea5fbc09007319c903066e7a618fe7ac782e6537

fix incorrect usage of libuv

view details

push time in 6 days

issue commentsewenew/redis-plus-plus

how to send a bgrewriteaof command to redis server using redis-plus-plus client?

You can use the generic interface to send these commands:

try {
    auto status = redis.command<std::string>("BGREWRITEAOF");
} catch (const ReplyError &e) {
    // error handle
}

Note: BGREWRITEAOF might return status reply or error reply. So you need to try to convert the reply to string (Redis::command<std::string>), and catch possible error reply (ReplyError exception).

Regards

vvvvjvvvv

comment created time in 6 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@labar90 According to OpenSSL community, that’s a bug for OpenSSL 1.x. Can you upgrade OpenSSL to 3.0, and try the original version of hiredis? Thanks!

Regards

dellorogiulio

comment created time in 6 days

push eventsewenew/vector-engine

sewenew

commit sha 3d996657f1afa9046b09d53f445c5021c6af705a

fix bugs

view details

push time in 7 days

issue commentopenssl/openssl

SSL_Read failed with SSL_ERROR_SYSCALL when read timeout

Hi guys, I got a similar problem. The library I depend on, seems not handle this case properly.

My question is that if SSL_get_error returns SSL_ERROR_SYSCALL and errno is set to 0, can I take it as a timeout for SSL_read?

Regards

zaher

comment created time in 7 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@labar90 I created a new issue to track this problem. I also made a hot fix for hiredis, and you can try this version of hiredis to see if it's solved the problem.

Please check this for detail.

Regards

dellorogiulio

comment created time in 7 days

push eventsewenew/hiredis

sewenew

commit sha 69d19d001288373962941e29e0b5ad50d2e17c2f

set errno to EAGAIN when SSL_read times out.

view details

push time in 7 days

push eventsewenew/hiredis

michael-grunder

commit sha 6204182aae71ca321418c069eac907936eeaa33a

Handle the case where an invalidation is sent second. RESP3 invalidation messages always seemed to be sent before the response to a given command, but it appears this is not always the case: In Redis 6.2.0RC1 Redis sends the invalidation after the HSET in the following sequence: ``` hget hash field $5 value hset hash field value :0 >2 $10 invalidate *1 $4 hash ``` To account for this possibility just wrap redisGetReplyFromReader in a loop as it is called twice in redisGetReply.

view details

michael-grunder

commit sha dfa33e60b07c13328133a16065d88d171a2a61d4

Change order independant push logic to not change behavior. Since redisGetReplyFromReader is exposed in a header file, we probably shouldn't modify how it behaves in any way. For this reason, handle the changed logic in an internal static helper method.

view details

Kristján Valur Jónsson

commit sha e06ecf7e45c6a976a2089240fe0b1eae3098e18a

Ignore timeout callback from a successful connect

view details

Hans Zandbelt

commit sha 5f4382247a0074d2080921956cd9784bbd1824c2

improve SSL leak fix redis/hiredis#896 Free SSL object when redisSSLConnect fails but avoid doing that for callers of redisInitiateSSL who are supposed to manager their own SSL object. Signed-off-by: Hans Zandbelt <hans.zandbelt@zmartzone.eu>

view details

plan-do-break-fix

commit sha 0743f57bbae3999206d13cdfd15e35740026698c

fix(docs): corrects typos in project README

view details

Michael Grunder

commit sha 959af9760972460017442697a127e55b4e70a39b

Merge pull request #949 from plan-do-break-fix/Typo-corrections fix(docs): corrects typos in project README

view details

Michael Grunder

commit sha 9bf6c250e5e0ed7e68377f2986877959aaa95920

Merge pull request #939 from zmartzone/improve_pr_896_ssl_leak improve SSL leak fix redis/hiredis#896

view details

Michael Grunder

commit sha 667dbf536524ba3f28c1d964793db1055c5a64f2

Merge pull request #935 from kristjanvalur/pr5 Bugfix: Ignore timeout callback from a successful connect (fixes #945)

view details

michael-grunder

commit sha b6f86f38c2bbf0caa63d489174ac3a9777b97807

Fix README.md Closes #929

view details

michael-grunder

commit sha 5850a8ecd2fb4ab39d80773e3017f02aff097ec4

Ensure we curry any connect error to an async context.

view details

Meir Shpilraien (Spielrein)

commit sha f5f31ff9b92b6bdf628716449d0d0782ceb7704a

Added REDIS_NO_AUTO_FREE_REPLIES flag (#962) When set hiredis will not automatically free replies in an async context, and the replies must be freed instead by the user. Co-authored-by: Michael Grunder <michael.grunder@gmail.com>

view details

rouzier

commit sha 2d9d77518d012a54ae34f9822e4b4d19823c4b75

Don't leak memory if an invalid type is set (#906) Co-authored-by: James Rouzier <jrouzier@inverse.ca>

view details

push time in 7 days

push eventsewenew/hiredis

push time in 7 days

issue openedsewenew/redis-plus-plus

Read timeout does not been properly handled on Windows platform with TLS

On Windows platform, openssl returns SSL_ERROR_SYSCALL and set errno/WASGetLastError to 0 in case of read timeout. Check this issue for detail.

However, hiredis takes this as an error instead of timeout, and that results in redis-plus-plus' incorrect behavior, i.e. not properly handle timeout on Windows platform with TLS. Check this issue for detail.

I made a hot fix by modifying hiredis' code to properly handle this case. The modified version of hiredis can be found here. If you get this problem, you can install this modified version of hiredis.

However, I'm not sure if this is the best way to solve the problem. So I'll keep this issue open, and try to seek help from openssl and hiredis community.

created time in 7 days

push eventsewenew/vector-engine

sewenew

commit sha 380f8b9d20ed99f4aa66f5835f6547c216139736

add worker pool

view details

push time in 8 days

push eventsewenew/vector-engine

sewenew

commit sha c34a5f6172a3cc7fe5d63cec5e0b408f08257f76

bunch of changes

view details

push time in 9 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 I add some debug info for hiredis. However, the code works fine on both Linux and macOS. I cannot reproduce your problem. Can you try the modified hiredis in your Windows env? The modified code is on the master branch of https://github.com/sewenew/hiredis

Please ensure that you uninstall the previously installed hiredis before install this modified version. If there're multiple versions of hiredis install, you'll get some wired problems.

When you run the code, please give me the output of the code. It should print some ssl debug info to stderr, and some redis-plus-plus error on stdout. Please give both error messages. Thanks!

Regards

dellorogiulio

comment created time in 9 days

push eventsewenew/hiredis

sewenew

commit sha cf24ef4ff748ed54d4c57d7dadabaeef1ba7df43

add ssl debug info

view details

push time in 9 days

issue commentsewenew/redis-plus-plus

Storing a vector of vectors of type int in a Redis cache

std::vector<std::vector<int>> is too complicated, and there's no built-in Redis data structure that can save it. So you need to serialize it into a string, and then save the string into Redis with Redis::set.

Regards

WilfredDube

comment created time in 9 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 Thanks for the info! It seems a bug of hiredis, which returns an IO error while the errno is 0. This should not happen. It seems that hiredis doesn't handle the SSL_read error properly. I'll do more digging.

// hiredis/ssl.c
        int err = SSL_get_error(rssl->ssl, nread);
        if (c->flags & REDIS_BLOCK) {     // <------------this might be the problem, even in blocking mode, we should check the returned err from SSL_read
            if (errno == EINTR) {
                return 0;
            } else {
                const char *msg = NULL;
                if (errno == EAGAIN) {
                    msg = "Resource temporarily unavailable";
                }
                __redisSetError(c, REDIS_ERR_IO, msg);
                return -1;
            }
        }

        /**
         * We can very well get an EWOULDBLOCK/EAGAIN, however
         */
        if (maybeCheckWant(rssl, err)) {

Regrads

dellorogiulio

comment created time in 10 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 I created a "debug" branch, which add some more error message when throwing error. Can you try the code on this debug branch, and give me the updated error message? So that I can do some debug on this problem. Thanks.

Regards

dellorogiulio

comment created time in 10 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 I created a "debug" branch, which add some more error message when throwing error. Can you try the code on this debug branch, and give me the updated error message? So that I can do some debug on this problem. Thanks.

Regards

dellorogiulio

comment created time in 10 days

issue commentsewenew/redis-plus-plus

Connection Broken when ConnectionOptions::socket_timeout is set

@Iabar90 I created a "debug" branch, which add some more error message when throwing error. Can you try the code on this debug branch, and give me the updated error message? So that I can do some debug on this problem. Thanks.

Regards

dellorogiulio

comment created time in 10 days

push eventsewenew/redis-plus-plus

sewenew

commit sha 3b10a40dc152d7f90ff84c4a4d6a0cce95953e3d

append more error info when throwing error

view details

push time in 10 days