Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:18
    paxcol opened #1213
  • Oct 20 19:43
    ile commented #809
  • Oct 20 19:43
    ile commented #809
  • Oct 20 19:39
    ile commented #809
  • Oct 20 12:41
    simonprickett commented #1083
  • Oct 20 12:37
    simonprickett commented #1176
  • Oct 20 11:53
    simonprickett commented #1185
  • Oct 20 11:47
    simonprickett commented #1212
  • Oct 20 11:47
    simonprickett commented #1212
  • Oct 20 03:12
    tlfu12344gmail opened #1212
  • Oct 20 00:29
    albertxiao closed #1208
  • Oct 20 00:29
    albertxiao commented #1208
  • Oct 19 14:33
    simonprickett edited #1211
  • Oct 19 14:33
    simonprickett opened #1211
  • Oct 19 04:52
    xiaoyong2305 closed #1210
  • Oct 19 04:52
    xiaoyong2305 commented #1210
  • Oct 18 18:16
    xiaoyong2305 opened #1210
  • Oct 16 16:52
    ColeTownsend commented #1042
  • Oct 16 13:27
    ShogunPanda synchronize #1201
  • Oct 16 13:14
    OPScorp edited #1209
luno
@luciano-nascimento
:)
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
Advaith Doosa
@AdvaithD
Hey all, was wondering if anyone has encountered issues with .scanStream({match: "*pattern"})
I keep getting empty arrays while watching the stream for data
Jonathan Yen
@jonyen
hi, would anyone know what's going on with this:
@400000005f6a655f02387564 [ioredis] Unhandled error event: ClusterAllFailedError: Failed to refresh slots cache.
@400000005f6a655f02387d34     at tryNode (/var/www/api4/node_modules/ioredis/built/cluster/index.js:359:31)
@400000005f6a655f0238811c     at /var/www/api4/node_modules/ioredis/built/cluster/index.js:376:21
@400000005f6a655f02388504     at Timeout.duplicatedConnection.cluster.utils_2.timeout (/var/www/api4/node_modules/ioredis/built/cluster/index.js:624:24)
@400000005f6a655f023888ec     at Timeout.run (/var/www/api4/node_modules/ioredis/built/utils/index.js:156:22)
@400000005f6a655f0238dedc     at listOnTimeout (timers.js:326:17)
@400000005f6a655f0238e2c4     at processTimers (timers.js:268:5)