mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Added module-acquire-GIL latency stats (#9608)
The new value indicates how long Redis wait to acquire the GIL after sleep. This can help identify problems where a module perform some background operation for a long time (with the GIL held) and blocks the Redis main thread.
This commit is contained in:
parent
f5160ed0aa
commit
4fb39b6700
10
src/server.c
10
src/server.c
@ -2973,7 +2973,15 @@ void afterSleep(struct aeEventLoop *eventLoop) {
|
||||
|
||||
/* Acquire the modules GIL so that their threads won't touch anything. */
|
||||
if (!ProcessingEventsWhileBlocked) {
|
||||
if (moduleCount()) moduleAcquireGIL();
|
||||
if (moduleCount()) {
|
||||
mstime_t latency;
|
||||
latencyStartMonitor(latency);
|
||||
|
||||
moduleAcquireGIL();
|
||||
|
||||
latencyEndMonitor(latency);
|
||||
latencyAddSampleIfNeeded("module-acquire-GIL",latency);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user