-
Notifications
You must be signed in to change notification settings - Fork 2
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
Suppress calls to cloud server for a Recovery Period after request failures. #134
Draft
drasmart
wants to merge
47
commits into
51Degrees:main
Choose a base branch
from
postindustria-tech:cancellation-tokens-4.4
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Suppress calls to cloud server for a Recovery Period after request failures. #134
drasmart
wants to merge
47
commits into
51Degrees:main
from
postindustria-tech:cancellation-tokens-4.4
Conversation
This file contains 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
…gine.FailHandling`
…get }` (via `LoadAspectProperties(ICloudRequestEngine)`).
…uring RecoveryPeriod.
…seconds` expires.
…eption` constructor.
…list` with interfaces." This reverts commit 1ce21c2.
…trategy.RecordFailure()` calls.
…gStrategy.RecordFailure()` calls.
…xception` as if `SuppressProcessExceptions = true` on `WebPipeline` level.
…lementAvailableProperties` (like `PropertiesNotYetLoadedException`).
…xception` as if `SuppressProcessExceptions = true` on `WebPipeline` level. pt.2.
drasmart
changed the title
[DRAFT] Suppress calls to cloud server for a Recovery Period after request failure.
Suppress calls to cloud server for a Recovery Period after request failure.
Oct 11, 2024
drasmart
changed the title
Suppress calls to cloud server for a Recovery Period after request failure.
[DRAFT] Suppress calls to cloud server for a Recovery Period after request failures.
Oct 15, 2024
drasmart
changed the title
[DRAFT] Suppress calls to cloud server for a Recovery Period after request failures.
Suppress calls to cloud server for a Recovery Period after request failures.
Oct 15, 2024
…sultService`. pt.2
drasmart
changed the title
Suppress calls to cloud server for a Recovery Period after request failures.
[DRAFT] Suppress calls to cloud server for a Recovery Period after request failures.
Oct 16, 2024
drasmart
changed the title
[DRAFT] Suppress calls to cloud server for a Recovery Period after request failures.
Suppress calls to cloud server for a Recovery Period after request failures.
Oct 16, 2024
Will need to also port this functionality to Java, Python, PHP, Node |
@BohdanVV Let's change the default timeout from 100 seconds to 2 seconds. |
@justadreamer @BohdanVV Please can you ensure that the error message and exception will be generated when in recovery mode is clear in the documentation and in the related specifications before this is marked as ready for review? |
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.
Changes
PipelineTemporarilyUnavailableException
.Pipeline
-- does not get thrown from [IPipeline.ElementAvailableProperties], but prevents caching.SuppressProcessExceptions
byWebPipeline
andPipelineResultService
--Process
will not throw, the error can be read from [IFlowData.Errors].IRecoveryStrategy
-- defines for how long to suppress calls after certain amount of "logical failures".InstantRecoveryStrategy
-- always allow new calls (pre-change behavior or no recovery period).NoRecoveryStrategy
-- does not allow any new calls ever after first failure.SimpleRecoveryStrategy
-- disallow new calls forRecoverySeconds
period after then most recent failure.IFailHandler
-- defines when to suppress calls.SimpleFailHandler
-- simply wraps providedIRecoveryStrategy
.WindowedFailHandler
-- wait for certain amount (failuresToEnterRecovery
) to accumulate within certain amount of time (failuresWindow
) before forwarding the failure to the underlingIRecoveryStrategy
. Also callsReset
upon first success after exiting Recovery Period.CloudRequestEngine
constructor.EndpointsAndKeys
struct (saved to read-only field).IFailHandler
parameter.CloudRequestEngineBuilder
now also uses this (new) constructor.AsyncLazyFailable
planned for v4.5CloudRequestEngineTemporarilyUnavailableException
(subclass ofPipelineTemporarilyUnavailableException
).CloudRequestEngine
whenIFailHandler
prevents (likely temporarily) sending requests to cloud server due to recent failures.SimpleThrottlingStrategy.RecoverySeconds
onCloudRequestEngineBuilder
.NoThrottlingStrategy
is used.WindowedFailHandler.FailuresToEnterRecovery
(min: 1, max: 100, default: 10) andWindowedFailHandler.FailuresWindowSeconds
(required to be positive, default: 100) onCloudRequestEngineBuilder
._loggerFactory
,_dataLogger
,_httpClient
) onCloudRequestEngineBuilder
as read-only.PipelineCapabilities
_availableElementProperties
to [ImmutableDictionary<TKey,TValue>.Empty] singleton ifflowData
has errors._baseCaps[key]
fromstring this[string key]
indexer (like done in explicitly implemented methods).flowData
whenWebPipeline.Process
throws.IFailThrottlingStrategy
.CloudRequestEngine
withSimpleThrottlingStrategy
.patch
file.Why
Test results
.nupkg
built by 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11368708022Manual tests of
Cloud/Framework-Web
example (v.4.4.110-alpha.1+pi.wip)with
.nupkg
from 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11297040712Block-listing in Charles
Reloading the page within recovery period (
"RecoveryMilliseconds": 60000
)^ did not produce new requests (only the initial 2 blocked ones from the first page load attempt can be seen)
After the recovery period
^ only 2 new requests were made.
Timeout due to latency by Charles
Conditions:
It takes around 6~10 second for the page to show error on [4.4.103]
While it still takes more than full awaiting of
TimeOutSeconds
(e.g. ~2.5s) for an error to propagate when outside Recovery Period on [4.4.110-alpha.1+pi.wip] :Within Recovery Period, error page loading time is much shorter (under 200ms locally) :
^ and the page does not fail, as though
SuppressProcessExceptions
istrue
.Manual tests of
Cloud/Framework-Web
example (v.4.4.113-alpha.1+pi.wip)with
.nupkg
from 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11335248015Default settings
Modified
FailuresToEnterRecovery
Modified
FailuresToEnterRecovery
andFailuresWindowSeconds
Manual tests of
Cloud/Framework-Web
example (v.4.4.115-alpha.1+pi.wip)with
.nupkg
from 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11349595554Modified
RecoverySeconds
Manual tests of
Cloud/Framework-Web
example (v.4.4.121-alpha.1+pi.wip)ASP.NET Core integration
with
.nupkg
from 📦 https://github.com/postindustria-tech/pipeline-dotnet/actions/runs/11368708022Cloud/GettingStarted-Web
to display suppressed errors. device-detection-dotnet-examples#350Unsuppressed
CloudRequestException
due to timeout :Suppressed
CloudRequestEngineTemporarilyUnavailableException
displayed byIndex.cshtml
: