Repository navigation
Add regression tests for disconnected event source cache targets - #2645
Open
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Open
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Conversation
Port of #2644 to staging/3.0. The 3.0 EventSourceCache already treats any failed IWeakReference.Resolve (including RPC_E_DISCONNECTED and RPC_S_SERVER_UNAVAILABLE) as an expired target, so no behavior change is needed. Document that behavior and add tests using a fake native IWeakReferenceSource. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
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.
Ports #2644 (fixes #2643) to
staging/3.0.Changes
In 3.0,
EventSourceCache.ResolveTargetUnsafealready treats any failedIWeakReference::ResolveHRESULT (includingRPC_E_DISCONNECTEDandHRESULT_FROM_WIN32(RPC_S_SERVER_UNAVAILABLE)) as an expired target, so lookup returns no state and replacement installs a fresh target and clears stale states. The 2.x bug (exceptions propagating) therefore does not exist here, and no behavior change is made.Unlike the 2.x PR, unrelated failures (
E_FAIL,E_ACCESSDENIED) are intentionally not propagated: narrowing would risk permanently blocking event registration for a reused native pointer, would miss other server-gone HRESULTs, andGetStateruns on the unsubscription path.ResolveTargetUnsafe.EventSourceCacheTestsusing[UnsafeAccessor]and a fake nativeIWeakReferenceSource/IWeakReferencewhoseResolvecan be made to fail: failed resolve is treated as expired inGetState,Createreplaces the target and drops old states, and live targets preserve states.Validation
Release x64 Native AOT publish of
UnitTest(warnings as errors on); all 11EventSourceCacheTeststests pass.