Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unique identifiers from runtime error title #45

Merged
merged 1 commit into from
Oct 19, 2023
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
Loading