by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 07 20:28
    ClaudiuCeia opened #1177
  • Aug 06 09:17
    ArminYang opened #1176
  • Aug 05 21:18
    ShraddhaMantri commented #1042
  • Aug 05 03:42
    cnwangjie synchronize #1175
  • Aug 05 03:29
    cnwangjie commented #1174
  • Aug 05 03:29
    cnwangjie commented #1174
  • Aug 05 03:25
    cnwangjie opened #1175
  • Aug 05 03:06
    luin commented #1174
  • Aug 05 02:56
    cnwangjie commented #1174
  • Aug 04 17:33
    luin commented #1174
  • Aug 04 12:57
    TrejGun commented #654
  • Aug 04 11:38
    cnwangjie opened #1174
  • Aug 04 09:37
    alesbolka commented #1109
  • Aug 04 05:50
    kaufmo opened #1173
  • Jul 31 03:50
    visitsb commented #711
  • Jul 30 19:23
    daparthi001 commented #711
  • Jul 29 15:27
    stockholmux opened #1172
  • Jul 28 23:03
    landerton commented #169
  • Jul 28 23:02
    landerton commented #169
  • Jul 28 22:49
    landerton commented #169
luno
@luciano-nascimento
hello, someone knows how to use a callback for errors during connection ?
Christian Roy
@roychri
redis.on( 'error', callbackhere );
luno
@luciano-nascimento
thanks
:)
bregard
@bregard
Where can I find some documentation on the function signatures... right now looking for "mset"...
but for instance "mget" takes an array which makes sense but does not match cli syntax at all...
bregard
@bregard
This document: https://aws.amazon.com/premiumsupport/knowledge-center/elasticache-crossslot-keys-error-redis/ mentions that "redis-py-cluster" can handle getting and setting keys (mget/mset) from slots located in different shards. Is this not possible with ioredis in cluster mode?
bregard
@bregard
In case anyone was wondering there is no magic in "redis-py-cluster"... Its just a wrapper that iterates GETs...
Uzlopak
@Uzlopak
is @luin also active in this chat?
Zihua Li
@luin

This document: https://aws.amazon.com/premiumsupport/knowledge-center/elasticache-crossslot-keys-error-redis/ mentions that "redis-py-cluster" can handle getting and setting keys (mget/mset) from slots located in different shards. Is this not possible with ioredis in cluster mode?

It's not possible with ioredis as it's "too magic"...as you said redis-py-cluster just uses multiple GETs so I afraid that abstract layer may mislead users (ex "MSET" is not atmic in cluster)

@Uzlopak not that active but still receive notifications especially for messages that mention me ;-)
TotallyNotElite
@TotallyNotElite_gitlab
I'm having some trouble with ioredis seemingly ignoring the connectTimeout option, which should be 10 seconds by default. The problem occurs when the IP address of the redis server is changed suddenly and the old one is suddenly unavailable. The client will disconnect and instantly try to reconnect (as intended), but the reconnect can take a VERY (we're talking 15 minutes maybe) long time, which is unacceptable for my usage.
network is an overlay network powered by docker swarm
Does anyone have any ideas as to what I'm missing? I'm sure its obvious :)
TotallyNotElite
@TotallyNotElite_gitlab
@luin I hope you don't mind me mentioning you!
TotallyNotElite
@TotallyNotElite_gitlab
Ok some more info: the reconnect takes a very long time because the server its trying to contact doesn't respond to anything, not even rejecting the connection (the server does no longer exist, essentially)
Looks like I'm having this issue: luin/ioredis#634
TotallyNotElite
@TotallyNotElite_gitlab
Ok some more clarification: it never attempts to reconnect in the first place, since it never detects the downtime
TotallyNotElite
@TotallyNotElite_gitlab
Heck, I can't even implement a ghetto fix, because there is no way to force disconnect a ioredis instance...
TotallyNotElite
@TotallyNotElite_gitlab
Yea I'm completely out of ideas at this point.
TotallyNotElite
@TotallyNotElite_gitlab
Looks like using something like https://github.com/hertzg/node-net-keepalive/ will work for me (in some projects), although it would be nice if @luin could add a proper heartbeat system that doesn't rely on napi modules. I'll probably implement my own hacky workaround.
luno
@luciano-nascimento
hello, how to use promises on ioredis ? do i really need a external library to that ?
Christian Roy
@roychri
You can use it like this:
redis.exists( key ).then( exists => {
    if ( exists ) {
        console.log( `${key} does exists` );
    } else {
        console.log( `${key} does NOT exists` );
    }
});
Or like this:
const exists = await redis.exists( key );
if ( exists ) {
    console.log( `${key} does exists` );
} else {
    console.log( `${key} does NOT exists` );
}
does that help @luciano-nascimento ?
luno
@luciano-nascimento
i need that to connect
to know if there is some error
i need to use promises instead callbacks
"error"
"connect"
luno
@luciano-nascimento
@Christian Roy do you know how to do that ?
Jakub Kisielewski
@kbkk

Anyone using ioredis with elasticache cluster mode?
I'm trying a failover scenario and my node process crashes (unhandled rejection) with:

Error: Connection is closed.
     at close (node_modules/.pnpm/registry.npmjs.org/ioredis/4.17.1/node_modules/ioredis/built/redis/event_handler.js:179:25)
    at Socket.<anonymous> (node_modules/.pnpm/registry.npmjs.org/ioredis/4.17.1/node_modules/ioredis/built/redis/event_handler.js:150:20)
    at Object.onceWrapper (events.js:418:26)
    at Socket.emit (events.js:311:20)
    at Socket.EventEmitter.emit (domain.js:482:12)
    at TCP.<anonymous> (net.js:668:12)

I'd happily post a debug log but I've exceeded elasticache failover api quota :/

luno
@luciano-nascimento
hello, there is someway to get redis version ?
i mean programmatically using ioredis
Christian Roy
@roychri
redis.info('server')
luno
@luciano-nascimento
thanks !
luno
@luciano-nascimento
@roychri I'm a little bit confused how to use that, could you give me a example how to do that or where to find some documentation ? I can see nothing on readme
luno
@luciano-nascimento
thanks i got it
sushmeet sunger
@Sushmeet
Hi all, looking for some clarification about the redis.scanStream method. I have a big redis cluster and at any given time I would like to iterate over the keys returned and perhaps return 5 or 10 in total
I thought of just existing the stream but not sure if that helps me but in the background it will still continue to keep streaming until it reaches the end. I am quite sure it will so wondering how if at all I can handle this use case thanks
Uzlopak
@Uzlopak
Hi
anyone active?
Sourav Ray
@souravray

I am facing issue in connecting to a single Elasticsearch instance. My code looks like bellow -

this.instance = new Redis({
      host: REDIS_HOST,
      port: REDIS_PORT,
      tls: {},
      connectTimeout: 10000,
      maxRetriesPerRequest: 4,
      retryStrategy: (times) => Math.min(times * 30, 1000),
      reconnectOnError: (error) => {
        const targetErrors = [/READONLY/, /ETIMEDOUT/];
        targetErrors.forEach((targetError) => {
          if (targetError.test(error.message)) {
            return true;
          }
        });
      }
    });
   RedisConnection.instance = this.instance;

I am getting following errors -

    errno: 'ECONNREFUSED',
    code: 'ECONNREFUSED',
   syscall: 'connect',
   address: '127.0.0.1',
   port: 6379

I have verified that host: REDIS_HOST has correct resource address and it is not passing 127.0.0.1 or localhost.

Sourav Ray
@souravray
Got the issue resolved. I think the community is not much active here.
Trung Tin Luong
@zerotn3
hi guys !
import Redis from 'ioredis';
readonly redis = new Redis(+DB_REDISPORT, DB_REDISHOST, { password: DB_REDISPASS });
Im using, but have error: [ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required.
plese help me for guide wrong