fix: wire --timeout through refresh-all and fix pipe request timeout#504
Merged
fix: wire --timeout through refresh-all and fix pipe request timeout#504
Conversation
Root causes: 1. ServiceClient.DefaultRequestTimeout was 300s, so the pipe layer always cancelled at 5 minutes regardless of --timeout on CLI or session open. 2. RefreshAll() had no timeout parameter, so --timeout on 'powerquery refresh-all' was silently ignored and cancellationToken: default meant the session operationTimeout had no effect either. Fixes: - RefreshAll() now accepts TimeSpan timeout (default 5 min) matching the Refresh() pattern: CancellationTokenSource(timeout) applied so the caller's --timeout is honoured end-to-end. - ServiceClient.DefaultRequestTimeout increased to TimeSpan.FromHours(2) so the pipe layer never races with the operation timeout. - StringHelper.GetDefaultValueString: non-nullable value-type params with '= default' (e.g. TimeSpan timeout = default) now emit 'default' instead of 'null' in generated Request DTOs. Nullable<T> structs keep 'null'. - SKILL.md corrected: timeout=0 uses the 5-min default, not an error.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two root causes combined to make
powerquery refresh-all --timeout 1800always cancel at exactly 5 minutes:ServiceClient.DefaultRequestTimeout = 300s— the pipe cancelled at 5 min regardless of any--timeoutvalue passed to the CLI.RefreshAll()had notimeoutparameter, so the--timeoutCLI flag was silently ignored, andcancellationToken: defaultwas passed tobatch.Execute().Fix
RefreshAll()now acceptsTimeSpan timeout = default(default: 5 minutes), matching the existingRefresh()pattern. ACancellationTokenSource(timeout)is created and its token passed tobatch.Execute().ServiceClient.DefaultRequestTimeoutincreased toTimeSpan.FromHours(2), ensuring the pipe layer never races with the operation timeout.StringHelper.GetDefaultValueString): non-nullable value-type parameters with= default(e.g.TimeSpan timeout = default) now emit"default"instead of"null"in generated code.Nullable<T>structs (bool?,int?) keep"null".timeout=0or omitted uses the 5-min default.Testing
Refresh_LoadedToDataModel_PreservesSettings) is a slow-environment flake: the Data Model refresh took 6m6s against the 5-minRefresh()timeout — unrelated to theseRefreshAllchanges.