Skip to content

Eliminate GetAwaiter().GetResult() from Kubernetes and installer async boundaries#1230

Open
jimmyp wants to merge 7 commits into
jimpelletier/eft-3295-tentacle-script-abandonment-to-release-the-mutexfrom
jimpelletier/eft-3295-eliminate-getawaiter-getresult
Open

Eliminate GetAwaiter().GetResult() from Kubernetes and installer async boundaries#1230
jimmyp wants to merge 7 commits into
jimpelletier/eft-3295-tentacle-script-abandonment-to-release-the-mutexfrom
jimpelletier/eft-3295-eliminate-getawaiter-getresult

Conversation

@jimmyp
Copy link
Copy Markdown

@jimmyp jimmyp commented May 22, 2026

Summary

Eliminates all .GetAwaiter().GetResult() calls from hot production code paths that were blocking unnecessarily after the EFT-3295 async migration.

  • IPrerequisite: Added CheckAsync(CancellationToken); PowerShellPrerequisite is now truly async
  • IOctopusFileSystem: Added EnsureDiskHasEnoughFreeSpaceAsync chain through Kubernetes file system, script workspace, workspace factory, ScriptServiceV2, FileTransferService, ScriptPodLogEncryptionKeyProvider
  • ConfigMapKeyValueStore: Async CreateAsync factory + SaveAsync/SetAsync/RemoveAsync on IWritableKeyValueStore
  • KubernetesMachineKeyEncryptor: Added InitializeAsync — key pre-loaded before any encrypt/decrypt

Remaining GetAwaiter (all acceptable)

  • WindowsServiceHost.cs — ServiceBase.Run worker thread (Windows SCM forced)
  • ConfigurationModule.cs x2 — Autofac sync factory (startup only)
  • ConfigMapKeyValueStore.cs x4 — IWritableKeyValueStore sync compat wrappers
  • KubernetesPhysicalFileSystem.cs x1 — sync bridge, not hit in production hot paths

🤖 Generated with Claude Code

jimmyp and others added 7 commits May 22, 2026 16:16
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…Prerequisite

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…m, IScriptWorkspace, ScriptWorkspaceFactory

Eliminates GetAwaiter().GetResult() from the hot paths in ScriptServiceV2 and
FileTransferService by threading async overloads all the way from
IOctopusFileSystem up through IScriptWorkspace.CheckReadinessAsync and
IScriptWorkspaceFactory.GetWorkspaceAsync. KubernetesPhysicalFileSystem now has
a true async EnsureDiskHasEnoughFreeSpaceAsync override; its sync bridge retains
one GetAwaiter only for inherently-sync config-store callers that never exercise
the Kubernetes disk-check path in production.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…hFreeSpaceAsync overload to avoid sync fallback

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…RemoveAsync

Replace Lazy<V1ConfigMap> + GetAwaiter init with a static CreateAsync factory
that eagerly loads ConfigMap data. Add SaveAsync/SetAsync/RemoveAsync overrides
that call configMapService.Patch asynchronously. Sync methods bridge to async
via GetAwaiter for compat. Add async variants to IWritableKeyValueStore with
default Task.FromResult implementations in KeyValueStoreBase. DI registrations
updated to call CreateAsync. ShowConfigurationCommand updated to await SaveAsync.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tAwaiter from EnsureMachineKeyAndIvLoaded

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… calls have explanatory comments

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jimmyp jimmyp requested review from a team as code owners May 22, 2026 08:32
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.

1 participant