Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

add wait for message queue to drain before final siege #88

Merged
merged 1 commit into from
Oct 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions base/HHVMDaemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public function needsRetranslatePause(): bool {
return $status !== '' && $status !== 'failure';
}

<<__Override>>
public function queueEmpty(): bool {
$status = $this->adminRequest('/check-queued');
if ($status === 'failure') {
return true;
}
return $status !== '' && $status === '0';
}

<<__Override>>
protected function getArguments(): Vector<string> {
if ($this->options->cpuBind) {
Expand Down
1 change: 1 addition & 0 deletions base/PHPEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public abstract function __toString(): string;
public function writeStats(): void {}

public function needsRetranslatePause(): bool { return false; }
public function queueEmpty(): bool { return true; }
}
6 changes: 6 additions & 0 deletions base/PerfRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ private static function RunWithOptionsAndEngine(
);
}

self::PrintProgress('Server warmed, checking queue status.');
while (!$options->skipWarmUp && !$php_engine->queueEmpty()) {
self::PrintProgress('Server warmed, waiting for queue to drain.');
sleep(10);
}

self::PrintProgress('Clearing nginx access.log');
$nginx->clearAccessLog();

Expand Down