Skip to content

Commit

Permalink
Initial replacement of Helios with DotNetty (#2444)
Browse files Browse the repository at this point in the history
* initial replacement of Helios with DotNetty

* hack for client to not connet to IPAddress.Any

* fixed public-hostname resolution

* initialized ssl tests

* integrated with DotNetty logging pipeline

* working ssl spec

* moved Helios transport to separate project + DotNetty backward compatibility spec for config

* working configuration compatibility between DotNetty & Helios

* minor fixes

* fixed tests logging and ssl tests

* setup byte-order for DotNetty transport

* fixed compatibility spec

* fixed sln file

* fixed MessageSerializerRemotingSpec

* fixed problems with F# projects

* fixed DNS public hostname specs

* fixed F# files again

* skipped ssl test for linux/mono

* last polishing

* post-rebase fixes
  • Loading branch information
Horusiath authored and Aaronontheweb committed Feb 5, 2017
1 parent 913b1ba commit c95b2d2
Show file tree
Hide file tree
Showing 105 changed files with 2,702 additions and 479 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,6 @@ target/

# API Approval received files
**/Akka.API.Tests/*.received.txt

# include self-signed test certificate for SSL Tests
!src/core/Akka.Remote.Tests/Resources/akka-validcert.pfx
14 changes: 14 additions & 0 deletions src/Akka.sln
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.Hyperion
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Serialization.Hyperion.Tests", "contrib\serializers\Akka.Serialization.Hyperion.Tests\Akka.Serialization.Hyperion.Tests.csproj", "{E3549E17-7206-44F0-A322-EDC058A0498F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Transports", "Transports", "{6AD34FA4-7584-454D-ACD4-A8911E0BDB00}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Akka.Remote.Transport.Helios", "contrib\transports\Akka.Remote.Transport.Helios\Akka.Remote.Transport.Helios.csproj", "{29FEAABC-E326-450A-9008-B5FCECF0115F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug Mono|Any CPU = Debug Mono|Any CPU
Expand Down Expand Up @@ -969,6 +973,14 @@ Global
{E3549E17-7206-44F0-A322-EDC058A0498F}.Release Mono|Any CPU.Build.0 = Release|Any CPU
{E3549E17-7206-44F0-A322-EDC058A0498F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E3549E17-7206-44F0-A322-EDC058A0498F}.Release|Any CPU.Build.0 = Release|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Debug Mono|Any CPU.ActiveCfg = Debug|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Debug Mono|Any CPU.Build.0 = Debug|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Release Mono|Any CPU.ActiveCfg = Release|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Release Mono|Any CPU.Build.0 = Release|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{29FEAABC-E326-450A-9008-B5FCECF0115F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1085,5 +1097,7 @@ Global
{53A657B3-D3CD-461E-9759-664331218060} = {76F58DC4-19F1-43EF-A6E2-EC1CC8395AC5}
{6C995BF6-1F8D-40EE-B608-68E36EA6A6F8} = {0E55F1F8-E212-43D7-A0C0-ACEA9794B0D7}
{E3549E17-7206-44F0-A322-EDC058A0498F} = {0E55F1F8-E212-43D7-A0C0-ACEA9794B0D7}
{6AD34FA4-7584-454D-ACD4-A8911E0BDB00} = {588C1513-FAB6-42C3-B6FC-3485F13620CF}
{29FEAABC-E326-450A-9008-B5FCECF0115F} = {6AD34FA4-7584-454D-ACD4-A8911E0BDB00}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
[assembly: AssemblyCompanyAttribute("Akka.NET Team")]
[assembly: AssemblyCopyrightAttribute("Copyright © 2013-2017 Akka.NET Team")]
[assembly: AssemblyTrademarkAttribute("")]
[assembly: AssemblyVersionAttribute("1.1.2.0")]
[assembly: AssemblyFileVersionAttribute("1.1.2.0")]
[assembly: AssemblyVersionAttribute("1.1.3.0")]
[assembly: AssemblyFileVersionAttribute("1.1.3.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ public void ClusterClient_must_reestablish_connection_to_receptionist_after_serv
// start new system on same port
var sys2 = ActorSystem.Create(
Sys.Name,
ConfigurationFactory.ParseString("akka.remote.helios.tcp.port=" + Cluster.Get(Sys).SelfAddress.Port).WithFallback(Sys.Settings.Config));
ConfigurationFactory.ParseString("akka.remote.dot-netty.tcp.port=" + Cluster.Get(Sys).SelfAddress.Port).WithFallback(Sys.Settings.Config));
Cluster.Get(sys2).Join(Cluster.Get(sys2).SelfAddress);
var service2 = sys2.ActorOf(Props.Create(() => new ClusterClientSpecConfig.TestService(TestActor)), "service2");
ClusterClientReceptionist.Get(sys2).RegisterService(service2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void A_Cluster_with_DistributedPubSub_must_handle_restart_of_nodes_with_s
var newSystem = ActorSystem.Create(
Sys.Name,
ConfigurationFactory
.ParseString($"akka.remote.helios.tcp.port={Cluster.Get(Sys).SelfAddress.Port}")
.ParseString($"akka.remote.dot-netty.tcp.port={Cluster.Get(Sys).SelfAddress.Port}")
.WithFallback(Sys.Settings.Config));
try
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Updater()
public LocalConcurrencySpec(ITestOutputHelper output)
: base(ConfigurationFactory.ParseString(@"
akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
akka.remote.helios.tcp.port = 0"),
akka.remote.dot-netty.tcp.port = 0"),
"LocalConcurrencySpec", output)
{
_replicator = DistributedData.Get(Sys).Replicator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class ReplicatedDataSerializerSpec : TestKit.Xunit2.TestKit
akka.actor {
provider=""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
}
akka.remote.helios.tcp.port = 0").WithFallback(DistributedData.DefaultConfig());
akka.remote.dot-netty.tcp.port = 0").WithFallback(DistributedData.DefaultConfig());

private readonly UniqueAddress _address1 = new UniqueAddress(new Address("akka.tcp", "sys", "some.host.org", 4711), 1);
private readonly UniqueAddress _address2 = new UniqueAddress(new Address("akka.tcp", "sys", "other.host.org", 4711), 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ReplicatorMessageSerializerSpec : TestKit.Xunit2.TestKit
akka.actor {
provider=""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
}
akka.remote.helios.tcp.port = 0").WithFallback(DistributedData.DefaultConfig());
akka.remote.dot-netty.tcp.port = 0").WithFallback(DistributedData.DefaultConfig());

private readonly UniqueAddress _address1 = new UniqueAddress(new Address("akka.tcp", "sys", "some.host.org", 4711), 1);
private readonly UniqueAddress _address2 = new UniqueAddress(new Address("akka.tcp", "sys", "other.host.org", 4711), 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public WriteAckAdapter(IActorRef replica)

public WriteAggregatorSpec(ITestOutputHelper output) : base(ConfigurationFactory.ParseString(@"
akka.actor.provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
akka.remote.helios.tcp.port = 0"), "WriteAggregatorSpec", output)
akka.remote.dot-netty.tcp.port = 0"), "WriteAggregatorSpec", output)
{
_nodes = ImmutableHashSet.CreateRange(new[] {_nodeA, _nodeB, _nodeC, _nodeD});
}
Expand Down
19 changes: 12 additions & 7 deletions src/contrib/testkits/Akka.TestKit.Xunit2/TestKit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class TestKit : TestKitBase , IDisposable
private static readonly XunitAssertions _assertions=new XunitAssertions();
private bool _isDisposed; //Automatically initialized to false;

protected readonly ITestOutputHelper Output;

/// <summary>
/// Create a new instance of the <see cref="TestKit"/> for xUnit class.
/// If no <paramref name="system"/> is passed in, a new system
Expand All @@ -33,7 +35,8 @@ public class TestKit : TestKitBase , IDisposable
public TestKit(ActorSystem system = null, ITestOutputHelper output = null)
: base(_assertions, system)
{
InitializeLogger(output);
Output = output;
InitializeLogger(Sys);
}

/// <summary>
Expand All @@ -46,7 +49,8 @@ public TestKit(ActorSystem system = null, ITestOutputHelper output = null)
public TestKit(Config config, string actorSystemName = null, ITestOutputHelper output = null)
: base(_assertions, config, actorSystemName)
{
InitializeLogger(output);
Output = output;
InitializeLogger(Sys);
}


Expand All @@ -58,7 +62,8 @@ public TestKit(Config config, string actorSystemName = null, ITestOutputHelper o
/// <param name="output">TBD</param>
public TestKit(string config, ITestOutputHelper output = null) : base(_assertions, ConfigurationFactory.ParseString(config))
{
InitializeLogger(output);
Output = output;
InitializeLogger(Sys);
}

/// <summary>
Expand Down Expand Up @@ -107,12 +112,12 @@ public void Dispose()
GC.SuppressFinalize(this);
}

private void InitializeLogger(ITestOutputHelper output)
protected void InitializeLogger(ActorSystem system)
{
if (output != null)
if (Output != null)
{
var system = (ExtendedActorSystem) Sys;
var logger = system.SystemActorOf(Props.Create(() => new TestOutputLogger(output)), "log-test");
var extSystem = (ExtendedActorSystem)system;
var logger = extSystem.SystemActorOf(Props.Create(() => new TestOutputLogger(Output)), "log-test");
logger.Tell(new InitializeLogger(system.EventStream));
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{29FEAABC-E326-450A-9008-B5FCECF0115F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Akka.Remote.Transport.Helios</RootNamespace>
<AssemblyName>Akka.Remote.Transport.Helios</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Google.ProtocolBuffers, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Google.ProtocolBuffers.Serialization, Version=2.4.1.555, Culture=neutral, PublicKeyToken=55f7125234beb589, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Google.ProtocolBuffers.2.4.1.555\lib\net40\Google.ProtocolBuffers.Serialization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Helios, Version=2.1.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Helios.2.1.3\lib\net45\Helios.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HeliosHelpers.cs" />
<Compile Include="HeliosTcpTransport.cs" />
<Compile Include="HeliosTransport.cs" />
<Compile Include="HeliosTransportSettings.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Akka.Remote.Transport.Helios.nuspec" />
<None Include="packages.config" />
<EmbeddedResource Include="remote.conf" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Akka.Remote\Akka.Remote.csproj">
<Project>{ea4ff8fd-7c53-49c8-b9aa-02e458b3e6a7}</Project>
<Name>Akka.Remote</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\core\Akka\Akka.csproj">
<Project>{5deddf90-37f0-48d3-a0b0-a5cbd8a7e377}</Project>
<Name>Akka</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>@project@</id>
<title>@project@@title@</title>
<version>@build.number@</version>
<authors>@authors@</authors>
<owners>@authors@</owners>
<description>(Legacy) Akka.NET remote transport layer based on Helios.</description>
<licenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</licenseUrl>
<projectUrl>https://github.com/akkadotnet/akka.net</projectUrl>
<iconUrl>http://getakka.net/images/AkkaNetLogo.Normal.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<releaseNotes>@releaseNotes@</releaseNotes>
<copyright>@copyright@</copyright>
<tags>@tags@</tags>
@dependencies@
@references@
</metadata>
</package>
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
//-----------------------------------------------------------------------
// <copyright file="HeliosHelpers.cs" company="Akka.NET Project">
// Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------
#region copyright
// -----------------------------------------------------------------------
// <copyright file="HeliosHelpers.cs" company="Akka.NET project">
// Copyright (C) 2009-2016 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2017 Akka.NET project <https://github.com/akkadotnet>
// </copyright>
// -----------------------------------------------------------------------
#endregion

using System;
using System.Net;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Event;
using Google.ProtocolBuffers;
using Helios;
using Helios.Buffers;
using Helios.Channels;
using Helios.Exceptions;
using Helios.Net;
using Helios.Ops;
using Helios.Serialization;
using Helios.Topology;

namespace Akka.Remote.Transport.Helios
{
Expand Down Expand Up @@ -55,7 +49,7 @@ public override void ChannelActive(IChannelHandlerContext context)
{
if (!WrappedTransport.ConnectionGroup.TryAdd(context.Channel))
{
Log.Warning("Unable to REMOVE channel [{0}->{1}](Id={2}) to connection group. May not shut down cleanly.",
Log.Warning("Unable to REMOVE channel [{0}->{1}](Id={2}) to connection group. May not shut down cleanly.",
context.Channel.LocalAddress, context.Channel.RemoteAddress, context.Channel.Id);
}
}
Expand Down Expand Up @@ -137,4 +131,3 @@ protected void Init(IChannel channel, IPEndPoint remoteSocketAddress, Address re
}
}
}

Loading

0 comments on commit c95b2d2

Please sign in to comment.