MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelKillTimedoutScripts

Function sentinelKillTimedoutScripts

app/redis-6.2.6/src/sentinel.c:955–972  ·  view source on GitHub ↗

Kill scripts in timeout, they'll be collected by the * sentinelCollectTerminatedScripts() function. */

Source from the content-addressed store, hash-verified

953/* Kill scripts in timeout, they'll be collected by the
954 * sentinelCollectTerminatedScripts() function. */
955void sentinelKillTimedoutScripts(void) {
956 listNode *ln;
957 listIter li;
958 mstime_t now = mstime();
959
960 listRewind(sentinel.scripts_queue,&li);
961 while ((ln = listNext(&li)) != NULL) {
962 sentinelScriptJob *sj = ln->value;
963
964 if (sj->flags & SENTINEL_SCRIPT_RUNNING &&
965 (now - sj->start_time) > SENTINEL_SCRIPT_MAX_RUNTIME)
966 {
967 sentinelEvent(LL_WARNING,"-script-timeout",NULL,"%s %ld",
968 sj->argv[0], (long)sj->pid);
969 kill(sj->pid,SIGKILL);
970 }
971 }
972}
973
974/* Implements SENTINEL PENDING-SCRIPTS command. */
975void sentinelPendingScriptsCommand(client *c) {

Callers 1

sentinelTimerFunction · 0.85

Calls 5

listRewindFunction · 0.85
listNextFunction · 0.85
sentinelEventFunction · 0.85
killFunction · 0.85
mstimeFunction · 0.70

Tested by

no test coverage detected