Git Product home page Git Product logo

redis_client's People

Contributors

mjohh avatar seiyap70 avatar shawn246 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

redis_client's Issues

double ConvertToString error

1480525631---1.48053e+09

std::string ConvertToString(double t)
{
std::stringstream sstream;
sstream << t;
return sstream.str();
}

int main(int argc, char *argv[])
{
time_t t = time(NULL);
double dt = (long) t;
std::cout<<std::to_string((int)t)<<"---"<<dt<<std::endl;
std::cout<<ConvertToString(dt)<<"---"<<std::endl;
return 0;
}
/opt/work/debug $ ./hh
1480525631---1.48053e+09
1.48053e+09---
/opt/work/debug $

reconnection always occur per each transactions when timeout is zero

It seems that the CRedisConnection::ConnRequest() method considers the server timeout value
in the configuration is always greater than zero.
But actually the default TIMEOUT value is zero in recent redis versions,
and TIMEOUT 0 means "the server never disconnects the clients".
Isn't it necessary to avoid reconnecting in the above situation?

I think the desirable code is like below.
if (!m_pContext || m_pRedisServ->m_nSerTimeout > 0 && tmNow - m_nUseTime >= m_pRedisServ->m_nSerTimeout)

Too many open files.

As I open more than 10 connections (CRedisClients), it starts giving error loading shared libraries libc.so.6 and pipe: too many open files.
If I run it with ulimit -u unlimited -n 65536, still it gives error, but now at around 100 threads.
Each thread is continuously reading or writing in a tight loop.

Compiling for ARM-linux

Compiling the module for ARM-linux, I get the following.

ERROR = internal compiler error : in tsubst_copy, at cp/pt.c:1135

Confirmed this is not with hiredis, as I've run and compiled the tests as well as used the shared object in another project. This is using gcc/g++ 4.6.3. Your test makefile also uses the flag '-m64'. Is this module only designed to work with 64-bit operating systems? If so please add to the README, happy to run more tests if you need.

Best,
G

Reconnect with zero timeout

I guess others have seen the issue, does this guy still maintain this repository? I have a fix I tried to push but wasn't allowed to.

Thanks

Bug: if one salve instance run "cluster failover" in redis-cluster, then all operations on this node will fail

I simply fix it by:
563 int CRedisCommand::CmdRequest(redisContext pContext)
564 {
565 if (m_nArgs <= 0)
566 return RC_PARAM_ERR;
567
568 if (!pContext)
569 return RC_RQST_ERR;
570
571 if (m_pReply)
572 {
573 freeReplyObject(m_pReply);
574 m_pReply = nullptr;
575 }
576
577 m_pReply = static_cast<redisReply *>(redisCommandArgv(pContext, m_nArgs, (const char *
)m_pszArgs, (const size_t *)m_pnArgsLen));
+578 return m_pReply ? (m_pReply->type != REDIS_REPLY_ERROR ? RC_SUCCESS : RC_RQST_ERR) : RC_RQST_ERR;
579 }

Please tell me if any errors

Can I do pub/sub with the API

Hi Shawn,
The interface seems very simple and effective.
However, I don't see anything related to publish/subscribe.
Can it be added easily?

Thanks
Patrick

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.