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

feat: retry and uniqid #127

Merged
merged 9 commits into from
Oct 30, 2024
Merged

feat: retry and uniqid #127

merged 9 commits into from
Oct 30, 2024

Conversation

loks0n
Copy link
Member

@loks0n loks0n commented Oct 29, 2024

  • runtimeHostname now uses \bin2hex(\random_bytes(16)) instead of \uniqid() for a more unique and secure identifier.
  • Adds activeRuntime extra to sentry to aid debugging
  • Adds a retry loop for execution requests to handle cURL errors CURLE_COULDNT_RESOLVE_HOST (6), and CURLE_COULDNT_CONNECT (7). The loop retries until successful or until the timeout is reached.

@loks0n loks0n requested a review from Meldiron October 29, 2024 17:12
@loks0n loks0n self-assigned this Oct 29, 2024
@@ -490,7 +490,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
->action(function (string $runtimeId, string $image, string $entrypoint, string $source, string $destination, string $outputDirectory, array $variables, string $runtimeEntrypoint, string $command, int $timeout, bool $remove, float $cpus, int $memory, string $version, string $restartPolicy, array $networks, Orchestration $orchestration, Table $activeRuntimes, Response $response, Log $log) {
$runtimeName = System::getHostname() . '-' . $runtimeId;

$runtimeHostname = \uniqid();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets check for more occurances, I think I saw multiplr

Copy link
Member Author

@loks0n loks0n Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one more usage in the build path name, but I don't think it's an issue with collision / or worth increasing the scope of this PR to address immediate function errors

app/http.php Show resolved Hide resolved
app/http.php Outdated Show resolved Hide resolved
@loks0n loks0n requested a review from Meldiron October 30, 2024 11:42
Copy link
Contributor

@christyjacob4 christyjacob4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Lets document these new env vars in the readme and we can merge

@christyjacob4 christyjacob4 merged commit a6d80e2 into main Oct 30, 2024
3 checks passed
@christyjacob4 christyjacob4 deleted the feat-retry-and-uniqid branch October 30, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants