Skip to content

Commit

Permalink
don’t select a totally busy process
Browse files Browse the repository at this point in the history
  • Loading branch information
CamJN committed Oct 14, 2024
1 parent a45c981 commit 8cff85c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/agent/Core/ApplicationPool/Group/ProcessListManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ Group::findBestProcessPreferringStickySessionId(unsigned int id) const {
Process *process = (*it).get();
if (process->getStickySessionId() == id) {
return process;
} else if (bestProcess == nullptr ||
} else if (!process->isTotallyBusy() && (bestProcess == nullptr ||
process->generation > bestProcess->generation ||
(process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime) ||
(process->generation == bestProcess->generation && process->spawnStartTime == bestProcess->spawnStartTime && process->busyness() < bestProcess->busyness())
) {
)) {
bestProcess = process;
}
}
Expand All @@ -95,11 +95,11 @@ Group::findBestProcess(const ProcessList &processes) const {
for (it = processes.begin(); it != end; it++) {
Process *process = (*it).get();

if (bestProcess == nullptr ||
if (!process->isTotallyBusy() && (bestProcess == nullptr ||
process->generation > bestProcess->generation ||
(process->generation == bestProcess->generation && process->spawnStartTime < bestProcess->spawnStartTime) ||
(process->generation == bestProcess->generation && process->spawnStartTime == bestProcess->spawnStartTime && process->busyness() < bestProcess->busyness())
) {
)) {
bestProcess = process;
}
}
Expand Down Expand Up @@ -127,11 +127,11 @@ Group::findBestEnabledProcess() const {
unsigned int gen = process->generation;
unsigned long long startTime = process->spawnStartTime;
int busyness = enabledProcessBusynessLevels[i];
if (bestProcess == nullptr ||
if (!process->isTotallyBusy() && (bestProcess == nullptr ||
gen > bestProcess->generation ||
(gen == bestProcessGen && startTime < bestProcessStartTime) ||
(gen == bestProcessGen && startTime == bestProcessStartTime && busyness < bestProcessBusyness)
) {
)) {
bestProcess = process;
bestProcessGen = gen;
bestProcessBusyness = busyness;
Expand Down

0 comments on commit 8cff85c

Please sign in to comment.