Skip to content

Commit

Permalink
Merge pull request #1453 from mikem8361/release/stable
Browse files Browse the repository at this point in the history
Update from 'master' branch
  • Loading branch information
mikem8361 authored Aug 19, 2020
2 parents e7b4de6 + 1ece79c commit 3f46098
Show file tree
Hide file tree
Showing 23 changed files with 665 additions and 336 deletions.
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>166610c56ff732093f0145a2911d4f6c40b786da</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20411.8">
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="5.0.0-beta.20417.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ecec08a0eebbd92bb9538e351d475582551d9092</Sha>
<Sha>83fda4b3f6d93e713749fd1b27c4a6d40b118b13</Sha>
</Dependency>
<Dependency Name="Microsoft.SymbolStore" Version="1.0.141001">
<Uri>https://github.com/dotnet/symstore</Uri>
<Sha>facabfb7992467f9bf4fdf985fe355896d7fbd47</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20411.8">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="5.0.0-beta.20417.6">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ecec08a0eebbd92bb9538e351d475582551d9092</Sha>
<Sha>83fda4b3f6d93e713749fd1b27c4a6d40b118b13</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="5.0.0-rc.1.20412.8">
<Uri>https://github.com/dotnet/runtime</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<SystemThreadingChannelsVersion>4.7.0</SystemThreadingChannelsVersion>
<XUnitVersion>2.4.1</XUnitVersion>
<XUnitAbstractionsVersion>2.0.3</XUnitAbstractionsVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20411.8</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20417.6</MicrosoftDotNetRemoteExecutorVersion>
<cdbsosversion>10.0.18362</cdbsosversion>
</PropertyGroup>
<PropertyGroup>
Expand Down
4 changes: 3 additions & 1 deletion eng/common/cross/toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ if(TARGET_ARCH_NAME STREQUAL "armel")
endif()
elseif(TARGET_ARCH_NAME STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
if(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv7-alpine-linux-musleabihf)
set(TOOLCHAIN "armv7-alpine-linux-musleabihf")
elseif(EXISTS ${CROSS_ROOTFS}/usr/lib/gcc/armv6-alpine-linux-musleabihf)
set(TOOLCHAIN "armv6-alpine-linux-musleabihf")
else()
set(TOOLCHAIN "arm-linux-gnueabihf")
Expand Down
26 changes: 13 additions & 13 deletions eng/common/templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ parameters:
NetEngLatestChannelId: 2
NetEngValidationChannelId: 9
NetDev5ChannelId: 131
NetDev6ChannelId: 1296
GeneralTestingChannelId: 529
NETCoreToolingDevChannelId: 548
NETCoreToolingReleaseChannelId: 549
NETInternalToolingChannelId: 551
NETCoreExperimentalChannelId: 562
NetEngServicesIntChannelId: 678
NetEngServicesProdChannelId: 679
Net5Preview7ChannelId: 1065
Net5Preview8ChannelId: 1155
Net5RC1ChannelId: 1157
NetCoreSDK313xxChannelId: 759
Expand Down Expand Up @@ -115,7 +115,7 @@ stages:
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/post-build/check-channel-consistency.ps1
arguments: -PromoteToChannels "$(TargetChannels)"
-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}}
-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}}

- job:
displayName: NuGet Validation
Expand Down Expand Up @@ -276,13 +276,13 @@ stages:
dependsOn: ${{ parameters.publishDependsOn }}
publishInstallersAndChecksums: ${{ parameters.publishInstallersAndChecksums }}
symbolPublishingAdditionalParameters: ${{ parameters.symbolPublishingAdditionalParameters }}
stageName: 'Net5_Preview7_Publish'
channelName: '.NET 5 Preview 7'
akaMSChannelName: 'net5/preview7'
channelId: ${{ parameters.Net5Preview7ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-symbols/nuget/v3/index.json'
stageName: 'NetCore_Dev6_Publish'
channelName: '.NET 6 Dev'
akaMSChannelName: 'net6/dev'
channelId: ${{ parameters.NetDev6ChannelId }}
transportFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json'
shippingFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json'
symbolsFeed: 'https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-symbols/nuget/v3/index.json'

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

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

- template: \eng\common\templates\post-build\channels\generic-public-channel.yml
parameters:
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
}
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20411.8"
"Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20417.6"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore" Version="$(MicrosoftAspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="$(MicrosoftAspNetCoreHttpsPolicyVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(MicrosoftAspNetCoreMvcVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Diagnostics.Tracing;
using System.Runtime.Serialization;
using Microsoft.Diagnostics.Monitoring.RestServer.Validation;
using Newtonsoft.Json;

namespace Microsoft.Diagnostics.Monitoring.RestServer.Models
{
Expand Down
12 changes: 11 additions & 1 deletion src/Microsoft.Diagnostics.Monitoring/RuntimeInfo.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
using System.IO;
using System;
using System.IO;
using System.Runtime.InteropServices;

namespace Microsoft.Diagnostics.Monitoring
{
public static class RuntimeInfo
{
public static bool IsDiagnosticsEnabled
{
get
{
string enableDiagnostics = Environment.GetEnvironmentVariable("COMPlus_EnableDiagnostics");
return string.IsNullOrEmpty(enableDiagnostics) || !"0".Equals(enableDiagnostics, StringComparison.Ordinal);
}
}

public static bool IsInDockerContainer
{
get
Expand Down
49 changes: 37 additions & 12 deletions src/Microsoft.Diagnostics.Monitoring/ServerEndpointInfoSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -52,10 +53,20 @@ public async ValueTask DisposeAsync()

if (null != _listenTask)
{
await _listenTask.ConfigureAwait(false);
try
{
await _listenTask.ConfigureAwait(false);
}
catch (Exception ex)
{
Debug.Fail(ex.Message);
}
}

_server?.Dispose();
if (null != _server)
{
await _server.DisposeAsync().ConfigureAwait(false);
}

_endpointInfosSemaphore.Dispose();

Expand All @@ -68,27 +79,27 @@ public async ValueTask DisposeAsync()
/// <summary>
/// Starts listening to the reversed diagnostics server for new connections.
/// </summary>
public void Listen()
public void Start()
{
Listen(ReversedDiagnosticsServer.MaxAllowedConnections);
Start(ReversedDiagnosticsServer.MaxAllowedConnections);
}

/// <summary>
/// Starts listening to the reversed diagnostics server for new connections.
/// </summary>
/// <param name="maxConnections">The maximum number of connections the server will support.</param>
public void Listen(int maxConnections)
public void Start(int maxConnections)
{
VerifyNotDisposed();

if (null != _server || null != _listenTask)
if (IsListening)
{
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Listen) + " method can only be called once.");
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Start) + " method can only be called once.");
}

_server = new ReversedDiagnosticsServer(_transportPath, maxConnections);
_server = new ReversedDiagnosticsServer(_transportPath);

_listenTask = ListenAsync(_cancellation.Token);
_listenTask = ListenAsync(maxConnections, _cancellation.Token);
}

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

VerifyIsListening();

using CancellationTokenSource linkedSource = CancellationTokenSource.CreateLinkedTokenSource(token, _cancellation.Token);
CancellationToken linkedToken = linkedSource.Token;

// Prune connections that no longer have an active runtime instance before
// returning the list of connections.
await _endpointInfosSemaphore.WaitAsync(linkedToken).ConfigureAwait(false);

try
{
// Check the transport for each endpoint info and remove it if the check fails.
Expand Down Expand Up @@ -146,7 +160,7 @@ private async Task PruneIfNotViable(IpcEndpointInfo info, CancellationToken toke
{
_endpointInfos.Remove(info);
OnRemovedEndpointInfo(info);
_server.RemoveConnection(info.RuntimeInstanceCookie);
_server?.RemoveConnection(info.RuntimeInstanceCookie);
}
}
}
Expand All @@ -155,8 +169,9 @@ private async Task PruneIfNotViable(IpcEndpointInfo info, CancellationToken toke
/// Accepts endpoint infos from the reversed diagnostics server.
/// </summary>
/// <param name="token">The token to monitor for cancellation requests.</param>
private async Task ListenAsync(CancellationToken token)
private async Task ListenAsync(int maxConnections, CancellationToken token)
{
_server.Start(maxConnections);
// Continuously accept endpoint infos from the reversed diagnostics server so
// that <see cref="ReversedDiagnosticsServer.AcceptAsync(CancellationToken)"/>
// is always awaited in order to to handle new runtime instance connections
Expand Down Expand Up @@ -207,7 +222,7 @@ private async Task ResumeAndQueueEndpointInfo(IpcEndpointInfo info, Cancellation
}
catch (Exception)
{
_server.RemoveConnection(info.RuntimeInstanceCookie);
_server?.RemoveConnection(info.RuntimeInstanceCookie);

throw;
}
Expand All @@ -229,6 +244,16 @@ private void VerifyNotDisposed()
}
}

private void VerifyIsListening()
{
if (!IsListening)
{
throw new InvalidOperationException(nameof(ServerEndpointInfoSource.Start) + " method must be called before invoking this operation.");
}
}

private bool IsListening => null != _server && null != _listenTask;

private class EndpointInfo : IEndpointInfo
{
private readonly IpcEndpointInfo _info;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,22 @@ internal void ResumeRuntimeFallback()
}
}

internal ProcessInfo GetProcessInfo()
{
IpcMessage message = new IpcMessage(DiagnosticsServerCommandSet.Process, (byte)ProcessCommandId.GetProcessInfo);
var response = IpcClient.SendMessage(_endpoint, message);
switch ((DiagnosticsServerResponseId)response.Header.CommandId)
{
case DiagnosticsServerResponseId.Error:
var hr = BitConverter.ToInt32(response.Payload, 0);
throw new ServerErrorException($"Get process info failed (HRESULT: 0x{hr:X8})");
case DiagnosticsServerResponseId.OK:
return ProcessInfo.Parse(response.Payload);
default:
throw new ServerErrorException($"Get process info failed - server responded with unknown command");
}
}

/// <summary>
/// Get all the active processes that can be attached to.
/// </summary>
Expand Down
Loading

0 comments on commit 3f46098

Please sign in to comment.