Skip to content

[Named Pipe] Check for pipe broken on WaitConnectionAsync #46182

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa46bce
[Named Pipe] Check for pipe broken on WaitConnectionAsync
simonferquel Jan 20, 2023
ed77f14
Run test on Linux and Mac (#45642)
Youssef1313 Jan 20, 2023
7560737
Update milestone assignments for PRs (#46178)
dougbu Jan 20, 2023
40dd230
Making `JsonOptions` AOT/Trimmer-safe with EnsureJsonTrimmability swi…
brunolins16 Jan 20, 2023
c77deeb
Skip Source Build for now (#46190)
wtgodbe Jan 20, 2023
9a79370
Remove now-redundant properties from AOT template (#46194)
halter73 Jan 20, 2023
ebbf5eb
string.Split to Span.Split (#46098)
BrennanConroy Jan 21, 2023
8d6d88e
Workaround fabricbot `addMielstone` task issue (#46195)
mkArtakMSFT Jan 21, 2023
1078da9
feat : Add `StringSyntax` for regex parameters (#40589)
ShreyasJejurkar Jan 21, 2023
9ec0753
Add DispatchExceptionAsync to ComponentBase (#46074)
Nick-Stanton Jan 21, 2023
0a3a01b
Allow minimal host to be created without default HostBuilder behavior…
eerhardt Jan 21, 2023
8714420
Fix route syntax highlighting parameter color (#46208)
JamesNK Jan 23, 2023
02635ec
Update dependencies from https://github.com/dotnet/arcade build 20230…
dotnet-maestro[bot] Jan 23, 2023
ac52b4d
Delete duplicate define (#46202)
Suchiman Jan 23, 2023
7369057
Don't depend on source-build job while it isn't running (#46220)
wtgodbe Jan 23, 2023
1a1ab56
[blazor][wasm][debug]Press alt-shift-d and open firefox debug tab att…
thaystg Jan 23, 2023
3261139
Move Kestrel shared source to src\Shared (#46112)
david-acker Jan 23, 2023
19e357b
[main] (deps): Bump src/submodules/googletest (#46214)
dependabot[bot] Jan 23, 2023
0e51178
Added withServerTimeout and withKeepAliveInterval to HubConnectionBui…
surayya-MS Jan 23, 2023
c5a59c4
Implement RouteHandlerServices.Map and use in RequestDelegateGenerato…
captainsafia Jan 23, 2023
9a118ce
Enumerate paramnames on startup (#46086)
marafiq Jan 23, 2023
351eccf
Update SDK (#46224)
sebastienros Jan 24, 2023
4b66d40
[SignalR] [Java] Log 'WebSocket stopped' once (#43532)
BrennanConroy Jan 24, 2023
b0e5f3d
Merge branch 'namedpipe/catch-io-exception-on-accept-async' of https:…
JamesNK Jan 24, 2023
7cb0ee9
Add logging
JamesNK Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -783,19 +783,20 @@ stages:
publishOnError: true
includeForks: true

# Source build
- template: /eng/common/templates/job/source-build.yml
parameters:
platform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
buildScript: './eng/build.sh $(_PublishArgs) --no-build-repo-tasks'
skipPublishValidation: true
jobProperties:
timeoutInMinutes: 120
variables:
# Log environment variables in binary logs to ease debugging
MSBUILDLOGALLENVIRONMENTVARIABLES: true
# Source build - skip until https://github.com/dotnet/source-build/issues/3111 is resolved
- ${{ if False }}:
- template: /eng/common/templates/job/source-build.yml
parameters:
platform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
buildScript: './eng/build.sh $(_PublishArgs) --no-build-repo-tasks'
skipPublishValidation: true
jobProperties:
timeoutInMinutes: 120
variables:
# Log environment variables in binary logs to ease debugging
MSBUILDLOGALLENVIRONMENTVARIABLES: true

# Publish to the BAR and perform source indexing. Wait until everything else is done.
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
Expand Down Expand Up @@ -830,7 +831,6 @@ stages:
- MacOS_Test
- Linux_Test
- Helix_x64
- Source_Build_Managed
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals 1es-windows-2019
Expand Down Expand Up @@ -869,7 +869,6 @@ stages:
- MacOS_Test
- Linux_Test
- Helix_x64
- Source_Build_Managed
pool:
name: NetCore1ESPool-Internal
# Visual Studio Enterprise - no BuildTools agents exist internally and job must run on Windows
Expand Down
100 changes: 14 additions & 86 deletions .github/fabricbot.json
Original file line number Diff line number Diff line change
Expand Up @@ -2566,7 +2566,7 @@
}
}
],
"taskName": "[Milestone Assignments] Assign `Current Milestone` to PRs merged to main"
"taskName": "[Milestone Assignments] Assign Milestone to PRs merged to the `main` branch"
}
},
{
Expand Down Expand Up @@ -2691,46 +2691,6 @@
]
}
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
"subCapability": "PullRequestResponder",
"version": "1.0",
"config": {
"conditions": {
"operator": "and",
"operands": [
{
"name": "isAction",
"parameters": {
"action": "merged"
}
},
{
"name": "prTargetsBranch",
"parameters": {
"branchName": "release/6.0"
}
}
]
},
"eventType": "pull_request",
"eventNames": [
"pull_request",
"issues",
"project_card"
],
"taskName": "Assign milestone to PRs merged to \"release/6.0\"",
"actions": [
{
"name": "addMilestone",
"parameters": {
"milestoneName": "6.0.2"
}
}
]
}
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
Expand Down Expand Up @@ -3107,7 +3067,7 @@
{
"name": "prTargetsBranch",
"parameters": {
"branchName": "release/5.0"
"branchName": "release/7.0"
}
}
]
Expand All @@ -3118,12 +3078,12 @@
"issues",
"project_card"
],
"taskName": "Add release/5.0 targeting PRs to the servicing project",
"taskName": "Add release/7.0 targeting PRs to the servicing project",
"actions": [
{
"name": "addMilestone",
"parameters": {
"milestoneName": "5.0.x"
"milestoneName": "7.0.x"
}
},
{
Expand Down Expand Up @@ -3362,46 +3322,6 @@
]
}
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
"subCapability": "PullRequestResponder",
"version": "1.0",
"config": {
"conditions": {
"operator": "and",
"operands": [
{
"name": "isAction",
"parameters": {
"action": "merged"
}
},
{
"name": "prTargetsBranch",
"parameters": {
"branchName": "release/3.1"
}
}
]
},
"eventType": "pull_request",
"eventNames": [
"pull_request",
"issues",
"project_card"
],
"taskName": "[Milestone Assignments] Assign Milestone to PRs merged to release/3.1 branch",
"actions": [
{
"name": "addMilestone",
"parameters": {
"milestoneName": "3.1.33"
}
}
]
}
},
{
"taskType": "trigger",
"capabilityId": "IssueResponder",
Expand Down Expand Up @@ -3433,10 +3353,14 @@
],
"taskName": "[Milestone Assignments] Assign Milestone to PRs merged to release/6.0 branch",
"actions": [
{
"name": "removeMilestone",
"parameters": {}
},
{
"name": "addMilestone",
"parameters": {
"milestoneName": "6.0.13"
"milestoneName": "6.0.14"
}
}
]
Expand Down Expand Up @@ -3473,10 +3397,14 @@
],
"taskName": "[Milestone Assignments] Assign Milestone to PRs merged to release/7.0 branch",
"actions": [
{
"name": "removeMilestone",
"parameters": {}
},
{
"name": "addMilestone",
"parameters": {
"milestoneName": "7.0.2"
"milestoneName": "7.0.3"
}
}
]
Expand Down
1 change: 1 addition & 0 deletions eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.Internal.Runtime.AspNetCore.Transport" />
<LatestPackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" />
<LatestPackageReference Include="Microsoft.DotNet.RemoteExecutor" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Design" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
<LatestPackageReference Include="Microsoft.EntityFrameworkCore.Relational" />
Expand Down
20 changes: 12 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -302,22 +302,26 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>1936b44855b8f30ea406f0b088b05839682bc20c</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23063.7">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23067.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1b04d6de502c4108ada6ea8e5ccefdc2ddc3ee7b</Sha>
<Sha>3600aa80a01e90f38a7b86b9d7c1264e091aa5a8</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.23063.7">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="8.0.0-beta.23067.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1b04d6de502c4108ada6ea8e5ccefdc2ddc3ee7b</Sha>
<Sha>3600aa80a01e90f38a7b86b9d7c1264e091aa5a8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="8.0.0-beta.23063.7">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="8.0.0-beta.23067.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1b04d6de502c4108ada6ea8e5ccefdc2ddc3ee7b</Sha>
<Sha>3600aa80a01e90f38a7b86b9d7c1264e091aa5a8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.23063.7">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.23067.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>1b04d6de502c4108ada6ea8e5ccefdc2ddc3ee7b</Sha>
<Sha>3600aa80a01e90f38a7b86b9d7c1264e091aa5a8</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="8.0.0-beta.23067.5">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3600aa80a01e90f38a7b86b9d7c1264e091aa5a8</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
5 changes: 3 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@
<MicrosoftEntityFrameworkCoreVersion>8.0.0-alpha.1.23068.4</MicrosoftEntityFrameworkCoreVersion>
<MicrosoftEntityFrameworkCoreDesignVersion>8.0.0-alpha.1.23068.4</MicrosoftEntityFrameworkCoreDesignVersion>
<!-- Packages from dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersVersion>8.0.0-beta.23063.7</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23063.7</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>8.0.0-beta.23067.5</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23067.5</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetRemoteExecutorVersion>8.0.0-beta.23067.5</MicrosoftDotNetRemoteExecutorVersion>
<!-- Packages from dotnet/source-build-externals -->
<MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>8.0.0-alpha.1.23062.2</MicrosoftSourceBuildIntermediatesourcebuildexternalsVersion>
<!-- Packages from dotnet/xdt -->
Expand Down
8 changes: 4 additions & 4 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"sdk": {
"version": "8.0.100-alpha.1.23061.8"
"version": "8.0.100-alpha.1.23073.1"
},
"tools": {
"dotnet": "8.0.100-alpha.1.23061.8",
"dotnet": "8.0.100-alpha.1.23073.1",
"runtimes": {
"dotnet/x86": [
"$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Expand All @@ -27,7 +27,7 @@
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.22.10",
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23063.7",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23063.7"
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23067.5",
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.23067.5"
}
}
13 changes: 13 additions & 0 deletions src/Components/Components/src/ComponentBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ protected Task InvokeAsync(Action workItem)
protected Task InvokeAsync(Func<Task> workItem)
=> _renderHandle.Dispatcher.InvokeAsync(workItem);

/// <summary>
/// Treats the supplied <paramref name="exception"/> as being thrown by this component. This will cause the
/// enclosing ErrorBoundary to transition into a failed state. If there is no enclosing ErrorBoundary,
/// it will be regarded as an exception from the enclosing renderer.
///
/// This is useful if an exception occurs outside the component lifecycle methods, but you wish to treat it
/// the same as an exception from a component lifecycle method.
/// </summary>
/// <param name="exception">The <see cref="Exception"/> that will be dispatched to the renderer.</param>
/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns>
protected Task DispatchExceptionAsync(Exception exception)
=> _renderHandle.DispatchExceptionAsync(exception);

void IComponent.Attach(RenderHandle renderHandle)
{
// This implicitly means a ComponentBase can only be associated with a single
Expand Down
2 changes: 2 additions & 0 deletions src/Components/Components/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#nullable enable
Microsoft.AspNetCore.Components.ComponentBase.DispatchExceptionAsync(System.Exception! exception) -> System.Threading.Tasks.Task!
Microsoft.AspNetCore.Components.RenderHandle.DispatchExceptionAsync(System.Exception! exception) -> System.Threading.Tasks.Task!
*REMOVED*Microsoft.AspNetCore.Components.NavigationManager.ToAbsoluteUri(string! relativeUri) -> System.Uri!
Microsoft.AspNetCore.Components.NavigationManager.ToAbsoluteUri(string? relativeUri) -> System.Uri!
12 changes: 12 additions & 0 deletions src/Components/Components/src/RenderHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ public void Render(RenderFragment renderFragment)
_renderer.AddToRenderQueue(_componentId, renderFragment);
}

/// <summary>
/// Dispatches an <see cref="Exception"/> to the <see cref="Renderer"/>.
/// </summary>
/// <param name="exception">The <see cref="Exception"/> that will be dispatched to the renderer.</param>
/// <returns>A <see cref="Task"/> that will be completed when the exception has finished dispatching.</returns>
public Task DispatchExceptionAsync(Exception exception)
{
var renderer = _renderer;
var componentId = _componentId;
return Dispatcher.InvokeAsync(() => renderer!.HandleComponentException(exception, componentId));
}

[DoesNotReturn]
private static void ThrowNotInitialized()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Components/Components/src/RenderTree/Renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,9 @@ private void UpdateRenderTreeToMatchClientState(ulong eventHandlerId, EventField
}
}

internal void HandleComponentException(Exception exception, int componentId)
=> HandleExceptionViaErrorBoundary(exception, GetRequiredComponentState(componentId));

/// <summary>
/// If the exception can be routed to an error boundary around <paramref name="errorSourceOrNull"/>, do so.
/// Otherwise handle it as fatal.
Expand Down
30 changes: 30 additions & 0 deletions src/Components/Components/test/RendererTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3612,6 +3612,22 @@ public async Task ExceptionsThrownAsynchronouslyDuringFirstRenderCanBeHandled()
Assert.Same(exception, Assert.Single(renderer.HandledExceptions).GetBaseException());
}

[Fact]
public async Task ExceptionsDispatchedOffSyncContextCanBeHandledAsync()
{
// Arrange
var renderer = new TestRenderer { ShouldHandleExceptions = true };
var component = new NestedAsyncComponent();
var exception = new InvalidTimeZoneException("Error from outside the sync context.");

// Act
renderer.AssignRootComponentId(component);
await component.ExternalExceptionDispatch(exception);

// Assert
Assert.Same(exception, Assert.Single(renderer.HandledExceptions).GetBaseException());
}

[Fact]
public async Task ExceptionsThrownAsynchronouslyAfterFirstRenderCanBeHandled()
{
Expand Down Expand Up @@ -5611,6 +5627,20 @@ public enum EventType
OnAfterRenderAsyncSync,
OnAfterRenderAsyncAsync,
}

public Task ExternalExceptionDispatch(Exception exception)
{
var tcs = new TaskCompletionSource();
Task.Run(async () =>
{
// Inside Task.Run, we're outside the call stack or task chain of the lifecycle method, so
// DispatchExceptionAsync is needed to get an exception back into the component
await DispatchExceptionAsync(exception);
tcs.SetResult();
});

return tcs.Task;
}
}

private class ComponentThatAwaitsTask : ComponentBase
Expand Down
Loading