Files
redis/tests/unit/moduleapi
Mincho Paskalev ad8c7de3fe Fix assertion in updateClientMemUsageAndBucket (#14152)
## Description

`updateClientMemUsageAndBucket` is called from the main thread to update
memory usage and memory bucket of a client. That's why it has assertion
that it's being called by the main thread.

But it may also be called from a thread spawned by a module.
Specifically, when a module calls `RedisModule_Call` which in turn calls
`call`->`replicationFeedMonitors`->`updateClientMemUsageAndBucket`.
This is generally safe as module calls inside a spawned thread should be
guarded by a call to `ThreadSafeContextLock`, i.e the module is holding
the GIL at this point.

This commit fixes the assertion inside `updateClientMemUsageAndBucket`
so that it encompasses that case also. Generally calls from
module-spawned threads are safe to operate on clients that are not
running on IO-threads when the module is holding the GIL.

---------

Co-authored-by: Yuan Wang <wangyuancode@163.com>
Co-authored-by: debing.sun <debing.sun@redis.com>
2025-07-02 11:55:57 +03:00
..
2024-12-23 14:16:40 +08:00
2022-08-23 12:37:56 +03:00
2025-03-20 10:35:53 +08:00
2025-02-06 13:16:33 +02:00