Skip to content
Merged
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
12 changes: 10 additions & 2 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ function removeAllRuntimes(Table $activeRuntimes, Orchestration $orchestration):
->param('runtimeId', '', new Text(64), 'Runtime unique ID.')
->param('timeout', '600', new Text(16), 'Maximum logs timeout.', true)
->inject('swooleResponse')
->action(function (string $runtimeId, string $timeoutStr, SwooleResponse $swooleResponse) {
->inject('log')
->action(function (string $runtimeId, string $timeoutStr, SwooleResponse $swooleResponse, Log $log) {
$timeout = \intval($timeoutStr);

$runtimeId = System::getHostname() . '-' . $runtimeId; // Used in Docker (name)
Expand All @@ -316,7 +317,14 @@ function removeAllRuntimes(Table $activeRuntimes, Orchestration $orchestration):
}

if ($i === 9) {
throw new Exception('Runtime not ready. Error Msg: ' . $output, 500);
$runtimeIdTokens = explode("-", $runtimeId);
$executorId = $runtimeIdTokens[0];
$functionId = $runtimeIdTokens[1];
$deploymentId = $runtimeIdTokens[2];
$log->addTag('executorId', $executorId);
$log->addTag('functionId', $functionId);
$log->addTag('deploymentId', $deploymentId);
throw new Exception('Runtime not ready. Container not found.', 500);
}

\usleep(500000);
Expand Down