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 new SessionConflict return code #3215

Merged

Conversation

eeSquared
Copy link
Contributor

Bubbles up a new return code SessionConflict to allow hosted compute to handle this case differently than other failures.

@eeSquared eeSquared requested a review from a team as a code owner March 21, 2024 18:56
@@ -42,7 +42,7 @@ public override void Initialize(IHostContext hostContext)
_brokerServer = HostContext.GetService<IBrokerServer>();
}

public async Task<Boolean> CreateSessionAsync(CancellationToken token)
public async Task<int> CreateSessionAsync(CancellationToken token)
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this layer, I wonder whether an enum would be more appropriate? I'm not sure it's appropriate for this layer to understand application return codes.

@@ -42,7 +42,7 @@ public override void Initialize(IHostContext hostContext)
_brokerServer = HostContext.GetService<IBrokerServer>();
}

public async Task<Boolean> CreateSessionAsync(CancellationToken token)
public async Task<Constants.Runner.CreateSessionResult> CreateSessionAsync(CancellationToken token)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mind moving the enum to a different place? This method return signature looks funny because the result value by definition is not a constant (i.e. it can be one of multiple different values).

Maybe the Runner.Listener namespace would be a good place to define the enum since usage is localized to that namespace.

@@ -49,5 +49,10 @@ if %ERRORLEVEL% EQU 4 (
exit /b 1
)

if %ERRORLEVEL% EQU 5 (
echo "Runner listener exit with Session Conflict error, stop the service, no retry needed."
exit /b 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good to get a review from Ting regarding these scripts. I looked over the changes and makes sense to me.

Odd that we return exit code 0 here but that looks to be consistent with other non-retriable errors.

@TingluoHuang TingluoHuang force-pushed the eesquared/session-conflict-return-code branch from 12f05a9 to f5e7b23 Compare March 27, 2024 18:44
@TingluoHuang TingluoHuang enabled auto-merge (squash) March 27, 2024 18:45
@TingluoHuang TingluoHuang merged commit f467e9e into actions:main Mar 27, 2024
10 checks passed
coolguy1771 referenced this pull request in coolguy1771/home-ops Apr 24, 2024
…316.0 ) (#4582)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/onedr0p/actions-runner](https://ghcr.io/onedr0p/actions-runner)
([source](https://github.com/actions/runner)) | minor | `2.315.0` ->
`2.316.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>actions/runner (ghcr.io/onedr0p/actions-runner)</summary>

###
[`v2.316.0`](https://github.com/actions/runner/releases/tag/v2.316.0)

[Compare
Source](https://github.com/actions/runner/compare/v2.315.0...v2.316.0)

##### What's Changed

- Load '\_runnerSettings' in the early point of JobRunner.cs by
[@&#8203;TingluoHuang](https://github.com/TingluoHuang) in
[https://github.com/actions/runner/pull/3218](https://github.com/actions/runner/pull/3218)
- Add new SessionConflict return code by
[@&#8203;eeSquared](https://github.com/eeSquared) in
[https://github.com/actions/runner/pull/3215](https://github.com/actions/runner/pull/3215)
- backoff if we retried polling for more than 50 times in less than
30minutes by [@&#8203;aiqiaoy](https://github.com/aiqiaoy) in
[https://github.com/actions/runner/pull/3232](https://github.com/actions/runner/pull/3232)
- Update dotnet sdk to latest version
[@&#8203;6](https://github.com/6).0.421 by
[@&#8203;github-actions](https://github.com/github-actions) in
[https://github.com/actions/runner/pull/3244](https://github.com/actions/runner/pull/3244)
- Cleanup enabled feature flags. by
[@&#8203;TingluoHuang](https://github.com/TingluoHuang) in
[https://github.com/actions/runner/pull/3246](https://github.com/actions/runner/pull/3246)
- Relax the condition to stop uploading to Results by
[@&#8203;yacaovsnc](https://github.com/yacaovsnc) in
[https://github.com/actions/runner/pull/3230](https://github.com/actions/runner/pull/3230)
- Cleanup enabled feature flags. by
[@&#8203;TingluoHuang](https://github.com/TingluoHuang) in
[https://github.com/actions/runner/pull/3248](https://github.com/actions/runner/pull/3248)
- Replace invalid file name chars in diag log name by
[@&#8203;ericsciple](https://github.com/ericsciple) in
[https://github.com/actions/runner/pull/3249](https://github.com/actions/runner/pull/3249)

##### New Contributors

- [@&#8203;eeSquared](https://github.com/eeSquared) made their first
contribution in
[https://github.com/actions/runner/pull/3215](https://github.com/actions/runner/pull/3215)
- [@&#8203;aiqiaoy](https://github.com/aiqiaoy) made their first
contribution in
[https://github.com/actions/runner/pull/3232](https://github.com/actions/runner/pull/3232)

**Full Changelog**:
actions/runner@v2.315.0...v2.316.0

*Note: Actions Runner follows a progressive release policy, so the
latest release might not be available to your enterprise, organization,
or repository yet.
To confirm which version of the Actions Runner you should expect, please
view the download instructions for your enterprise, organization, or
repository.
See
https://docs.github.com/en/enterprise-cloud@latest/actions/hosting-your-own-runners/adding-self-hosted-runners*

##### Windows x64

We recommend configuring the runner in a root folder of the Windows
drive (e.g. "C:\actions-runner"). This will help avoid issues related to
service identity folder permissions and long file path restrictions on
Windows.

The following snipped needs to be run on `powershell`:

```powershell

##### Create a folder under the drive root
mkdir \actions-runner ; cd \actions-runner

##### Download the latest runner package
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-win-x64-2.316.0.zip -OutFile actions-runner-win-x64-2.316.0.zip

##### Extract the installer
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\actions-runner-win-x64-2.316.0.zip", "$PWD")
```

##### \[Pre-release] Windows arm64

**Warning:** Windows arm64 runners are currently in preview status and
use [unofficial versions of
nodejs](https://unofficial-builds.nodejs.org/). They are not intended
for production workflows.

We recommend configuring the runner in a root folder of the Windows
drive (e.g. "C:\actions-runner"). This will help avoid issues related to
service identity folder permissions and long file path restrictions on
Windows.

The following snipped needs to be run on `powershell`:

```powershell

##### Create a folder under the drive root
mkdir \actions-runner ; cd \actions-runner

##### Download the latest runner package
Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-win-arm64-2.316.0.zip -OutFile actions-runner-win-arm64-2.316.0.zip

##### Extract the installer
Add-Type -AssemblyName System.IO.Compression.FileSystem ;
[System.IO.Compression.ZipFile]::ExtractToDirectory("$PWD\actions-runner-win-arm64-2.316.0.zip", "$PWD")
```

##### OSX x64

```bash

##### Create a folder
mkdir actions-runner && cd actions-runner

##### Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-osx-x64-2.316.0.tar.gz

##### Extract the installer
tar xzf ./actions-runner-osx-x64-2.316.0.tar.gz
```

##### OSX arm64 (Apple silicon)

```bash

##### Create a folder
mkdir actions-runner && cd actions-runner

##### Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-osx-arm64-2.316.0.tar.gz

##### Extract the installer
tar xzf ./actions-runner-osx-arm64-2.316.0.tar.gz
```

##### Linux x64

```bash

##### Create a folder
mkdir actions-runner && cd actions-runner

##### Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-linux-x64-2.316.0.tar.gz

##### Extract the installer
tar xzf ./actions-runner-linux-x64-2.316.0.tar.gz
```

##### Linux arm64

```bash

##### Create a folder
mkdir actions-runner && cd actions-runner

##### Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-linux-arm64-2.316.0.tar.gz

##### Extract the installer
tar xzf ./actions-runner-linux-arm64-2.316.0.tar.gz
```

##### Linux arm

```bash

##### Create a folder
mkdir actions-runner && cd actions-runner

##### Download the latest runner package
curl -O -L https://github.com/actions/runner/releases/download/v2.316.0/actions-runner-linux-arm-2.316.0.tar.gz

##### Extract the installer
tar xzf ./actions-runner-linux-arm-2.316.0.tar.gz
```

##### Using your self hosted runner

For additional details about configuring, running, or shutting down the
runner please check out our [product
docs.](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/adding-self-hosted-runners)

##### SHA-256 Checksums

The SHA-256 checksums for the packages included in this build are shown
below:

- actions-runner-win-x64-2.316.0.zip <!-- BEGIN SHA win-x64
-->9b2d0443d11ce5c2c4391d708576dc37b1ecf62edcceec7c0c9c8e6b4472b5a1<!--
END SHA win-x64 -->
- actions-runner-win-arm64-2.316.0.zip <!-- BEGIN SHA win-arm64
-->7fb93a9b63aa76da722ead7b4a4e2404c11ed8620f9ae952a8aade27fed6eecd<!--
END SHA win-arm64 -->
- actions-runner-osx-x64-2.316.0.tar.gz <!-- BEGIN SHA osx-x64
-->41c63427093d61e2cb65c470d0955163442f23817a81fbadd46276179688e5ce<!--
END SHA osx-x64 -->
- actions-runner-osx-arm64-2.316.0.tar.gz <!-- BEGIN SHA osx-arm64
-->8442d39e3d91b67807703ec0825cec4384837b583305ea43a495a9867b7222ca<!--
END SHA osx-arm64 -->
- actions-runner-linux-x64-2.316.0.tar.gz <!-- BEGIN SHA linux-x64
-->64a47e18119f0c5d70e21b6050472c2af3f582633c9678d40cb5bcb852bcc18f<!--
END SHA linux-x64 -->
- actions-runner-linux-arm64-2.316.0.tar.gz <!-- BEGIN SHA linux-arm64
-->03ea42d347d9ad2d875ea03c2321a0e6507c8575edaa6a75fbe8edfefe0e2a74<!--
END SHA linux-arm64 -->
- actions-runner-linux-arm-2.316.0.tar.gz <!-- BEGIN SHA linux-arm
-->5059dda203b6b3b29bd591536b2d68231a425afc0fe022f27fd154ea6f441e23<!--
END SHA linux-arm -->

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTkuMCIsInVwZGF0ZWRJblZlciI6IjM3LjMxOS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
ericsciple pushed a commit to ericsciple/runner that referenced this pull request Jul 5, 2024
* Add new SessionConflict return code

* formatting

* Change return type of CreateSessionAsync to new enum

* Update entry scripts to handle new exit code

* Move enum
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