Comments (9)
@Prem-Kumar-98 can you share your test code?
from my testing it's generally not a redis issue, maybe relate to client.
from redis.
Hi @sundb ,
Below is the code snippet for the test method as requested. I've replaced sensitive information with generic placeholders for confidentiality:
Class exampleFileName(){
Constructor() {
this.client = RedisInstance.getRedis();
this.redisService = RedisSubscriberClient.getRedis();
}
async testMethod() {
await this.client.unsubscribe("__keyspace@0__:" + timerKey);
await this.redisService.setex("__keyspace@0__:" + timerKey, 60);
this.client.subscribe("__keyspace@0__:" + timerKey, (message, channel) => {
console.log("Testing event triggered", message, channel);
}).then((response) => {
log.info("Timer set! " + response);
});
}
}
Let me know if you need further assistance or clarification.
I have a question regarding the behavior of a node-redis client. If a node-redis client subscribes to a channel twice with different instances, will it emit the expired event twice?
from redis.
I have a question regarding the behavior of a node-redis client. If a node-redis client subscribes to a channel twice with different instances, will it emit the expired event twice?
yes, they are two connections.
from redis.
So, as you can see, i'm unsubscribing the channel before subscribing to it. In this case, why is the expired event emitting twice in the rarest case?
from redis.
@Prem-Kumar-98 can you share the notificatiions you received?
from redis.
Hi @sundb , I donβt have logs or notification details. I'm using GCP Redis Labs, and I could see the subscribed callback got triggered twice.
this.client.subscribe("__keyspace@0__:" + timerKey, (message, channel) => {
console.log("Testing event triggered", message, channel);
})
from redis.
@Prem-Kumar-98 what's your config notify-keyspace-events
?
first at all, if you are using KEA
, the script you give will receive three notification:
__keyspace@0__k set
__keyspace@0__k expire
__keyspace@0__k expired
from redis.
@sundb ,Keyspace event I configured the cloud service and verified that with the configuration I have from my end, it will emit the event only for expired, because it's not happening all the time; in the rarest case, it's emitting the expired events twice.
from redis.
@Prem-Kumar-98 sorry, from the clues i don't know the reason.
go through the code, the expired
notification was just send from one place, at the same we will remove it from the database.
i don't think one key can be expred two times.
from redis.
Related Issues (20)
- [BUG]sentinel failed to failover while master was down.[4.0.14]
- Protocol feature proposal: RESP3 (+?) correlation (long term) HOT 1
- [QUESTION]What are the side affects of setting cluster-allow-replica-migration to "no"?
- [BUG] Wrong error logged when `reclaimFilePageCache` fails
- [CRASH] Redis 7.0.12 crashed in zsetDel
- Understand how auto AOF rewrite works HOT 7
- Enable redis stream in redis helm chart bitnami with terraform HOT 1
- [BUG] CWE: 664 HOT 1
- [BUG] There is a memory leak defect at line 5981 of the file redis-cli.c in /redis/src/. HOT 4
- [NEW] Support for Ubuntu 24.04 HOT 1
- [BUG]There is a memory leak defect at line 3615 in the file /redis/src/redis-cli.c. HOT 2
- Wrong HSETF command description HOT 2
- [BUG] HGETF command is not replying with string HOT 3
- [QUESTION]The company saves costs and uses redisCluster mode. Is it okay to use a 1.5C docker container?
- [BUG] When the bus_port is inaccessible, creating a cluster using redis-cli will result in an infinite wait without returning a failure HOT 1
- [QUESTION] Moving keys from the wrong shard
- [QUESTION] Use lua script to prompt moved?
- new version 7.2.5 not offered to be upgraded
- help please
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis.