Skip to content

Commit

Permalink
Expose resource based autotuning (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushisource authored Jul 1, 2024
1 parent 9ce6b8f commit 29753e5
Show file tree
Hide file tree
Showing 41 changed files with 5,334 additions and 2,124 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,23 @@ jobs:

- name: Regen confirm unchanged
if: ${{ matrix.checkTarget }}
# Needs to be 16.0.0 until https://github.com/dotnet/ClangSharp/pull/506 released
run: |
dotnet tool install --global --version 16.0.0 ClangSharpPInvokeGenerator
dotnet tool install --global --version 18.1.0 ClangSharpPInvokeGenerator
ClangSharpPInvokeGenerator @src/Temporalio/Bridge/GenerateInterop.rsp
dotnet run --project src/Temporalio.Api.Generator
npx doctoc README.md
git config --global core.safecrlf false
git diff > generator.diff
git diff --exit-code
- name: Upload generator diff
uses: actions/upload-artifact@v4
if: always()
with:
name: generator-diff
path: generator.diff
if-no-files-found: ignore

- name: Check format
if: ${{ matrix.checkTarget }}
run: dotnet format --verify-no-changes
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,9 @@ Then, run:
The Rust DLL is built automatically when the project is built. `protoc` may need to be on the `PATH` to build the Rust
DLL.

This can be annoying to install on linux - so alternatively, publish your PR and you can download the
patch from the windows build when it fails because of a mismatch. It uploads the patch as an artifact.

### Regenerating protos

Must have `protoc` on the `PATH`. Note, for now users should use `protoc` 23.x until
Expand Down
366 changes: 213 additions & 153 deletions src/Temporalio/Api/Command/V1/Message.cs

Large diffs are not rendered by default.

22 changes: 14 additions & 8 deletions src/Temporalio/Api/Enums/V1/FailedCause.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,23 @@ static FailedCauseReflection() {
"RUNVVElPTl9OT1RfRk9VTkQQARJHCkNTSUdOQUxfRVhURVJOQUxfV09SS0ZM",
"T1dfRVhFQ1VUSU9OX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LkVudW1zLlYx",
"6gIaVGVtcG9yYWxpbzo6QXBpOjpFbnVtczo6VjFiBnByb3RvMw=="));
"U0VfQVBTX0xJTUlUEAYSNgoyUkVTT1VSQ0VfRVhIQVVTVEVEX0NBVVNFX1BF",
"UlNJU1RFTkNFX1NUT1JBR0VfTElNSVQQByqPAQoWUmVzb3VyY2VFeGhhdXN0",
"ZWRTY29wZRIoCiRSRVNPVVJDRV9FWEhBVVNURURfU0NPUEVfVU5TUEVDSUZJ",
"RUQQABImCiJSRVNPVVJDRV9FWEhBVVNURURfU0NPUEVfTkFNRVNQQUNFEAES",
"IwofUkVTT1VSQ0VfRVhIQVVTVEVEX1NDT1BFX1NZU1RFTRACQogBChhpby50",
"ZW1wb3JhbC5hcGkuZW51bXMudjFCEEZhaWxlZENhdXNlUHJvdG9QAVohZ28u",
"dGVtcG9yYWwuaW8vYXBpL2VudW1zL3YxO2VudW1zqgIXVGVtcG9yYWxpby5B",
"cGkuRW51bXMuVjHqAhpUZW1wb3JhbGlvOjpBcGk6OkVudW1zOjpWMWIGcHJv",
"dG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Temporalio.Api.Enums.V1.WorkflowTaskFailedCause), typeof(global::Temporalio.Api.Enums.V1.StartChildWorkflowExecutionFailedCause), typeof(global::Temporalio.Api.Enums.V1.CancelExternalWorkflowExecutionFailedCause), typeof(global::Temporalio.Api.Enums.V1.SignalExternalWorkflowExecutionFailedCause), typeof(global::Temporalio.Api.Enums.V1.ResourceExhaustedCause), typeof(global::Temporalio.Api.Enums.V1.ResourceExhaustedScope), }, null, null));
Expand Down Expand Up @@ -264,6 +266,10 @@ public enum ResourceExhaustedCause {
/// Caller exceeds action per second limit.
/// </summary>
[pbr::OriginalName("RESOURCE_EXHAUSTED_CAUSE_APS_LIMIT")] ApsLimit = 6,
/// <summary>
/// Persistence storage limit exceeded.
/// </summary>
[pbr::OriginalName("RESOURCE_EXHAUSTED_CAUSE_PERSISTENCE_STORAGE_LIMIT")] PersistenceStorageLimit = 7,
}

public enum ResourceExhaustedScope {
Expand Down
11 changes: 8 additions & 3 deletions src/Temporalio/Api/Enums/V1/TaskQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,13 @@ public enum TaskReachability {

/// <summary>
/// Specifies which category of tasks may reach a versioned worker of a certain Build ID.
///
/// Task Reachability is eventually consistent; there may be a delay until it converges to the most
/// accurate value but it is designed in a way to take the more conservative side until it converges.
/// For example REACHABLE is more conservative than CLOSED_WORKFLOWS_ONLY.
///
/// Note: future activities who inherit their workflow's Build ID but not its Task Queue will not be
/// accounted for reachability as server cannot not know if they'll happen as they do not use
/// accounted for reachability as server cannot know if they'll happen as they do not use
/// assignment rules of their Task Queue. Same goes for Child Workflows or Continue-As-New Workflows
/// who inherit the parent/previous workflow's Build ID but not its Task Queue. In those cases, make
/// sure to query reachability for the parent/previous workflow's Task Queue as well.
Expand All @@ -136,8 +141,8 @@ public enum BuildIdTaskReachability {
/// </summary>
[pbr::OriginalName("BUILD_ID_TASK_REACHABILITY_UNSPECIFIED")] Unspecified = 0,
/// <summary>
/// Build ID may be used by new workflows or activities (base on versioning rules), or there are
/// open workflows or backlogged activities assigned to it.
/// Build ID may be used by new workflows or activities (base on versioning rules), or there MAY
/// be open workflows or backlogged activities assigned to it.
/// </summary>
[pbr::OriginalName("BUILD_ID_TASK_REACHABILITY_REACHABLE")] Reachable = 1,
/// <summary>
Expand Down
Loading

0 comments on commit 29753e5

Please sign in to comment.