Skip to content

Commit 3f46098

Browse files
authored
Merge pull request #1453 from mikem8361/release/stable
Update from 'master' branch
2 parents e7b4de6 + 1ece79c commit 3f46098

23 files changed

+665
-336
lines changed

eng/Version.Details.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
<Uri>https://github.com/dotnet/command-line-api</Uri>
55
<Sha>166610c56ff732093f0145a2911d4f6c40b786da</Sha>
66
</Dependency>
7-
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20411.8">
7+
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20417.6">
88
<Uri>https://github.com/dotnet/arcade</Uri>
9-
<Sha>ecec08a0eebbd92bb9538e351d475582551d9092</Sha>
9+
<Sha>83fda4b3f6d93e713749fd1b27c4a6d40b118b13</Sha>
1010
</Dependency>
1111
<Dependency Name="Microsoft.SymbolStore" Version="1.0.141001">
1212
<Uri>https://github.com/dotnet/symstore</Uri>
1313
<Sha>facabfb7992467f9bf4fdf985fe355896d7fbd47</Sha>
1414
</Dependency>
1515
</ProductDependencies>
1616
<ToolsetDependencies>
17-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20411.8">
17+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20417.6">
1818
<Uri>https://github.com/dotnet/arcade</Uri>
19-
<Sha>ecec08a0eebbd92bb9538e351d475582551d9092</Sha>
19+
<Sha>83fda4b3f6d93e713749fd1b27c4a6d40b118b13</Sha>
2020
</Dependency>
2121
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-rc.1.20412.8">
2222
<Uri>https://github.com/dotnet/runtime</Uri>

eng/Versions.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<SystemThreadingChannelsVersion>4.7.0</SystemThreadingChannelsVersion>
5555
<XUnitVersion>2.4.1</XUnitVersion>
5656
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
57-
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20411.8</MicrosoftDotNetRemoteExecutorVersion>
57+
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20417.6</MicrosoftDotNetRemoteExecutorVersion>
5858
<cdbsosversion>10.0.18362</cdbsosversion>
5959
</PropertyGroup>
6060
<PropertyGroup>

eng/common/cross/toolchain.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ if(TARGET_ARCH_NAME STREQUAL "armel")
1919
endif()
2020
elseif(TARGET_ARCH_NAME STREQUAL "arm")
2121
set(CMAKE_SYSTEM_PROCESSOR armv7l)
22-
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
22+
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf)
23+
set(TOOLCHAIN "armv7-alpine-linux-musleabihf")
24+
elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
2325
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
2426
else()
2527
set(TOOLCHAIN "arm-linux-gnueabihf")

eng/common/templates/post-build/post-build.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ parameters:
3939
NetEngLatestChannelId: 2
4040
NetEngValidationChannelId: 9
4141
NetDev5ChannelId: 131
42+
NetDev6ChannelId: 1296
4243
GeneralTestingChannelId: 529
4344
NETCoreToolingDevChannelId: 548
4445
NETCoreToolingReleaseChannelId: 549
4546
NETInternalToolingChannelId: 551
4647
NETCoreExperimentalChannelId: 562
4748
NetEngServicesIntChannelId: 678
4849
NetEngServicesProdChannelId: 679
49-
Net5Preview7ChannelId: 1065
5050
Net5Preview8ChannelId: 1155
5151
Net5RC1ChannelId: 1157
5252
NetCoreSDK313xxChannelId: 759
@@ -115,7 +115,7 @@ stages:
115115
inputs:
116116
filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1
117117
arguments: -PromoteToChannels "$(TargetChannels)"
118-
-AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview7ChannelId}},${{parameters.Net5Preview8ChannelId}},${{parameters.Net5RC1ChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}}
118+
-AvailableChannelIds ${{parameters.NetEngLatestChannelId}},${{parameters.NetEngValidationChannelId}},${{parameters.NetDev5ChannelId}},${{parameters.NetDev6ChannelId}},${{parameters.GeneralTestingChannelId}},${{parameters.NETCoreToolingDevChannelId}},${{parameters.NETCoreToolingReleaseChannelId}},${{parameters.NETInternalToolingChannelId}},${{parameters.NETCoreExperimentalChannelId}},${{parameters.NetEngServicesIntChannelId}},${{parameters.NetEngServicesProdChannelId}},${{parameters.Net5Preview8ChannelId}},${{parameters.Net5RC1ChannelId}},${{parameters.NetCoreSDK313xxChannelId}},${{parameters.NetCoreSDK313xxInternalChannelId}},${{parameters.NetCoreSDK314xxChannelId}},${{parameters.NetCoreSDK314xxInternalChannelId}},${{parameters.VS166ChannelId}},${{parameters.VS167ChannelId}},${{parameters.VS168ChannelId}},${{parameters.VSMasterChannelId}}
119119

120120
- job:
121121
displayName: NuGet Validation
@@ -276,13 +276,13 @@ stages:
276276
dependsOn: ${{ parameters.publishDependsOn }}
277277
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
278278
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
279-
stageName: 'Net5_Preview7_Publish'
280-
channelName: '.NET 5 Preview 7'
281-
akaMSChannelName: 'net5/preview7'
282-
channelId: ${{ parameters.Net5Preview7ChannelId }}
283-
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
284-
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
285-
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
279+
stageName: 'NetCore_Dev6_Publish'
280+
channelName: '.NET 6 Dev'
281+
akaMSChannelName: 'net6/dev'
282+
channelId: ${{ parameters.NetDev6ChannelId }}
283+
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json'
284+
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json'
285+
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json'
286286

287287
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
288288
parameters:
@@ -298,7 +298,7 @@ stages:
298298
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v3/index.json'
299299
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-symbols/nuget/v3/index.json'
300300

301-
- template: \eng\common\templates\post-build\channels\generic-internal-channel.yml
301+
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
302302
parameters:
303303
artifactsPublishingAdditionalParameters: ${{ parameters.artifactsPublishingAdditionalParameters }}
304304
dependsOn: ${{ parameters.publishDependsOn }}
@@ -308,9 +308,9 @@ stages:
308308
channelName: '.NET 5 RC 1'
309309
akaMSChannelName: 'net5/rc1'
310310
channelId: ${{ parameters.Net5RC1ChannelId }}
311-
transportFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v3/index.json'
312-
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal/nuget/v3/index.json'
313-
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-symbols/nuget/v3/index.json'
311+
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
312+
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
313+
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
314314

315315
- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
316316
parameters:

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
}
1414
},
1515
"msbuild-sdks": {
16-
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20411.8"
16+
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20417.6"
1717
}
1818
}

src/Microsoft.Diagnostics.Monitoring.RestServer/Microsoft.Diagnostics.Monitoring.RestServer.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
55
<NoWarn>;1591;1701</NoWarn>
66
<Description>REST Api surface for dotnet-monitor</Description>
77
<!-- Tentatively create package so other teams can tenatively consume. -->
@@ -15,7 +15,7 @@
1515
<OutputType>Library</OutputType>
1616
</PropertyGroup>
1717

18-
<ItemGroup>
18+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
1919
<PackageReference Include="Microsoft.AspNetCore" Version="$(MicrosoftAspNetCoreVersion)" />
2020
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="$(MicrosoftAspNetCoreHttpsPolicyVersion)" />
2121
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcVersion)" />

src/Microsoft.Diagnostics.Monitoring.RestServer/Models/EventPipeProviderModel.cs

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Diagnostics.Tracing;
77
using System.Runtime.Serialization;
88
using Microsoft.Diagnostics.Monitoring.RestServer.Validation;
9-
using Newtonsoft.Json;
109

1110
namespace Microsoft.Diagnostics.Monitoring.RestServer.Models
1211
{

src/Microsoft.Diagnostics.Monitoring/RuntimeInfo.cs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using System.Runtime.InteropServices;
34

45
namespace Microsoft.Diagnostics.Monitoring
56
{
67
public static class RuntimeInfo
78
{
9+
public static bool IsDiagnosticsEnabled
10+
{
11+
get
12+
{
13+
string enableDiagnostics = Environment.GetEnvironmentVariable("COMPlus_EnableDiagnostics");
14+
return string.IsNullOrEmpty(enableDiagnostics) || !"0".Equals(enableDiagnostics, StringComparison.Ordinal);
15+
}
16+
}
17+
818
public static bool IsInDockerContainer
919
{
1020
get

src/Microsoft.Diagnostics.Monitoring/ServerEndpointInfoSource.cs

+37-12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using System;
66
using System.Collections.Generic;
7+
using System.Diagnostics;
78
using System.Linq;
89
using System.Threading;
910
using System.Threading.Tasks;
@@ -52,10 +53,20 @@ public async ValueTask DisposeAsync()
5253

5354
if (null != _listenTask)
5455
{
55-
await _listenTask.ConfigureAwait(false);
56+
try
57+
{
58+
await _listenTask.ConfigureAwait(false);
59+
}
60+
catch (Exception ex)
61+
{
62+
Debug.Fail(ex.Message);
63+
}
5664
}
5765

58-
_server?.Dispose();
66+
if (null != _server)
67+
{
68+
await _server.DisposeAsync().ConfigureAwait(false);
69+
}
5970

6071
_endpointInfosSemaphore.Dispose();
6172

@@ -68,27 +79,27 @@ public async ValueTask DisposeAsync()
6879
/// <summary>
6980
/// Starts listening to the reversed diagnostics server for new connections.
7081
/// </summary>
71-
public void Listen()
82+
public void Start()
7283
{
73-
Listen(ReversedDiagnosticsServer.MaxAllowedConnections);
84+
Start(ReversedDiagnosticsServer.MaxAllowedConnections);
7485
}
7586

7687
/// <summary>
7788
/// Starts listening to the reversed diagnostics server for new connections.
7889
/// </summary>
7990
/// <param name="maxConnections">The maximum number of connections the server will support.</param>
80-
public void Listen(int maxConnections)
91+
public void Start(int maxConnections)
8192
{
8293
VerifyNotDisposed();
8394

84-
if (null != _server || null != _listenTask)
95+
if (IsListening)
8596
{
86-
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Listen) + " method can only be called once.");
97+
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Start) + " method can only be called once.");
8798
}
8899

89-
_server = new ReversedDiagnosticsServer(_transportPath, maxConnections);
100+
_server = new ReversedDiagnosticsServer(_transportPath);
90101

91-
_listenTask = ListenAsync(_cancellation.Token);
102+
_listenTask = ListenAsync(maxConnections, _cancellation.Token);
92103
}
93104

94105
/// <summary>
@@ -100,12 +111,15 @@ public async Task<IEnumerable<IEndpointInfo>> GetEndpointInfoAsync(CancellationT
100111
{
101112
VerifyNotDisposed();
102113

114+
VerifyIsListening();
115+
103116
using CancellationTokenSource linkedSource = CancellationTokenSource.CreateLinkedTokenSource(token, _cancellation.Token);
104117
CancellationToken linkedToken = linkedSource.Token;
105118

106119
// Prune connections that no longer have an active runtime instance before
107120
// returning the list of connections.
108121
await _endpointInfosSemaphore.WaitAsync(linkedToken).ConfigureAwait(false);
122+
109123
try
110124
{
111125
// Check the transport for each endpoint info and remove it if the check fails.
@@ -146,7 +160,7 @@ private async Task PruneIfNotViable(IpcEndpointInfo info, CancellationToken toke
146160
{
147161
_endpointInfos.Remove(info);
148162
OnRemovedEndpointInfo(info);
149-
_server.RemoveConnection(info.RuntimeInstanceCookie);
163+
_server?.RemoveConnection(info.RuntimeInstanceCookie);
150164
}
151165
}
152166
}
@@ -155,8 +169,9 @@ private async Task PruneIfNotViable(IpcEndpointInfo info, CancellationToken toke
155169
/// Accepts endpoint infos from the reversed diagnostics server.
156170
/// </summary>
157171
/// <param name="token">The token to monitor for cancellation requests.</param>
158-
private async Task ListenAsync(CancellationToken token)
172+
private async Task ListenAsync(int maxConnections, CancellationToken token)
159173
{
174+
_server.Start(maxConnections);
160175
// Continuously accept endpoint infos from the reversed diagnostics server so
161176
// that <see cref="ReversedDiagnosticsServer.AcceptAsync(CancellationToken)"/>
162177
// is always awaited in order to to handle new runtime instance connections
@@ -207,7 +222,7 @@ private async Task ResumeAndQueueEndpointInfo(IpcEndpointInfo info, Cancellation
207222
}
208223
catch (Exception)
209224
{
210-
_server.RemoveConnection(info.RuntimeInstanceCookie);
225+
_server?.RemoveConnection(info.RuntimeInstanceCookie);
211226

212227
throw;
213228
}
@@ -229,6 +244,16 @@ private void VerifyNotDisposed()
229244
}
230245
}
231246

247+
private void VerifyIsListening()
248+
{
249+
if (!IsListening)
250+
{
251+
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Start) + " method must be called before invoking this operation.");
252+
}
253+
}
254+
255+
private bool IsListening => null != _server && null != _listenTask;
256+
232257
private class EndpointInfo : IEndpointInfo
233258
{
234259
private readonly IpcEndpointInfo _info;

src/Microsoft.Diagnostics.Monitoring/ServiceCollectionExtensions.cs

-29
This file was deleted.

src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/DiagnosticsClient.cs

+16
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,22 @@ internal void ResumeRuntimeFallback()
174174
}
175175
}
176176

177+
internal ProcessInfo GetProcessInfo()
178+
{
179+
IpcMessage message = new IpcMessage(DiagnosticsServerCommandSet.Process, (byte)ProcessCommandId.GetProcessInfo);
180+
var response = IpcClient.SendMessage(_endpoint, message);
181+
switch ((DiagnosticsServerResponseId)response.Header.CommandId)
182+
{
183+
case DiagnosticsServerResponseId.Error:
184+
var hr = BitConverter.ToInt32(response.Payload, 0);
185+
throw new ServerErrorException($"Get process info failed (HRESULT: 0x{hr:X8})");
186+
case DiagnosticsServerResponseId.OK:
187+
return ProcessInfo.Parse(response.Payload);
188+
default:
189+
throw new ServerErrorException($"Get process info failed - server responded with unknown command");
190+
}
191+
}
192+
177193
/// <summary>
178194
/// Get all the active processes that can be attached to.
179195
/// </summary>

0 commit comments

Comments
 (0)