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

Add retries when downloading GraalVM components #6880

Closed
hubertp opened this issue May 29, 2023 · 1 comment · Fixed by #7079
Closed

Add retries when downloading GraalVM components #6880

hubertp opened this issue May 29, 2023 · 1 comment · Fixed by #7079

Comments

@hubertp
Copy link
Collaborator

hubertp commented May 29, 2023

A fresh copy of GraalVM installs all the required components from ttps://www.graalvm.org/component-catalog.
There have been occasions when network can drop or the endpoint return some invalid message, resulting in a broken engine initialization and backend won't start. Successive runs would succeed making the reproduction steps rather cryptic:

[trace] [2023-05-25T07:54:17.582Z] [org.enso.runtimeversionmanager.components.GraalVMComponentUpdater] /home/hubert/.local/share/enso/tmp/runtime-22.3.1-java17-867911184/graalvm-ce-java17-22.3.1/bin/gu { exists=true, executable=true }
[debug] [2023-05-25T07:54:17.582Z] [org.enso.runtimeversionmanager.components.GraalVMComponentUpdater] Executing: JAVA_HOME=/home/hubert/.local/share/enso/tmp/runtime-22.3.1-java17-867911184/graalvm-ce-java17-22.3.1 GRRAALVM_HOME=/home/hubert/.local/share/enso/tmp/runtime-22.3.1-java17-867911184/graalvm-ce-java17-22.3.1 /home/hubert/.local/share/enso/tmp/runtime-22.3.1-java17-867911184/graalvm-ce-java17-22.3.1/bin/gu install js R python
[trace] [2023-05-25T07:54:17.594Z] [org.enso.runtimeversionmanager.components.GraalVMComponentUpdater] [stderr] Error: Error downloading component catalog from https://www.graalvm.org/component-catalog/v2/graal-updater-component-catalog-java17.properties: www.graalvm.org. 
[trace] [2023-05-25T07:54:17.594Z] [org.enso.runtimeversionmanager.components.GraalVMComponentUpdater] [stderr] Please check your connection and proxy settings. If your machine is behind a proxy, you must set your environment variables (http_proxy, https_proxy, ...) appropriately.
[error] [2023-05-25T07:54:17.748Z] [org.enso.projectmanager.requesthandler.ProjectOpenHandler] Request ProjectOpen with Number(2) failed due to ComponentInstallationFailure(fatal: Cannot install the required runtime components.).
[debug] [2023-05-25T07:54:17.75Z] [org.enso.projectmanager.requesthandler.ProjectOpenHandler] stopped
[trace] [2023-05-25T07:54:17.75Z] [org.enso.jsonrpc.JsonRpcServer] Sent text message {"jsonrpc":"2.0","id":2,"error":{"code":4023,"message":"fatal: Cannot install the required runtime components."}}.

The action is currently attempted only once, without any retries. We need a few retries with exponential backoff to deal with random issues that can happen on the way.

@enso-bot
Copy link

enso-bot bot commented Jun 20, 2023

Hubert Plociniczak reports a new STANDUP for yesterday (2023-06-19):

Progress: Adding retries to updater. Investigating problems with running benchmarks in SBT for non-runtime project; will need a separate ticket as it doesn't seem to be trivial. Reviewing reported issues, various discussions. It should be finished by 2023-06-20.

Next Day: Next day I will be working on the #6880 task. Put up PR with the fix. Pick up next ticket.

hubertp added a commit that referenced this issue Jun 20, 2023
The change adds logic that will attempt a few retries when executing `gu`
(GraalVM updater) commands. Previously, if it failed, it failed.
Retries should help with the most common case - occassional network
hiccups.

Note that I don't use an external library for retries on purpose. Didn't
want to introduce a yet another dependency for this tiny functionality.

Closes #6880.
@hubertp hubertp moved this from 🔧 Implementation to 👁️ Code review in Issues Board Jun 22, 2023
hubertp added a commit that referenced this issue Jun 23, 2023
The change adds logic that will attempt a few retries when executing `gu`
(GraalVM updater) commands. Previously, if it failed, it failed.
Retries should help with the most common case - occassional network
hiccups.

Note that I don't use an external library for retries on purpose. Didn't
want to introduce a yet another dependency for this tiny functionality.

Closes #6880.
@mergify mergify bot closed this as completed in #7079 Jun 23, 2023
mergify bot pushed a commit that referenced this issue Jun 23, 2023
The change adds logic that will attempt a few retries when executing `gu` (GraalVM updater) commands. Previously, if it failed, it failed. Retries should help with the most common case - occassional network hiccups.

Closes #6880.

# Important Notes
Note that I don't use an external library for retries on purpose. Didn't want to introduce a yet another dependency for this tiny functionality.
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants