Skip to content

Commit

Permalink
Merge branch 'dev' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb authored Jul 27, 2023
2 parents 9bdb67f + 28bdef6 commit 64509e2
Show file tree
Hide file tree
Showing 644 changed files with 3,486 additions and 2,540 deletions.
75 changes: 73 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,77 @@
#### 1.5.8 May 17th 2023 ####
#### 1.5.10 July 26th 2023 ####

**Placeholder for nightlies**
Akka.NET v1.5.9 is a maintenance release with a minor API change.

* [Persistence.TCK: Add constructor overload that takes ActorSystemSetup argument](https://github.com/akkadotnet/akka.net/pull/6850)

If you want to see the [full set of changes made in Akka.NET v1.5.10, click here](https://github.com/akkadotnet/akka.net/milestone/92?closed=1).

| COMMITS | LOC+ | LOC- | AUTHOR |
|---------|------|------|---------------------|
| 1 | 70 | 12 | Gregorius Soedharmo |

#### 1.5.9 July 18th 2023 ####

Akka.NET v1.5.9 is a maintenance release that introduces some performance improvements and internal code cleanup/modernization.

__Changes:__
* [Remoting: Make transport adapter component public](https://github.com/akkadotnet/akka.net/pull/6838)

__Improvements:__
* [Memory optimization, use `Array.Empty` instead of creating empty arrays](https://github.com/akkadotnet/akka.net/pull/6801)
* [Remoting: Log all wrapped message layers during errors](https://github.com/akkadotnet/akka.net/pull/6818)
* [Port #6805 and #6807, Improve Stream and Pattern.Backoff instance creation time performance](https://github.com/akkadotnet/akka.net/pull/6821)
* [DData: Harden LWWDictionary serialization null check](https://github.com/akkadotnet/akka.net/pull/6837)

__Code modernization:__
* [Use C# 9.0 target-typed new()](https://github.com/akkadotnet/akka.net/pull/6798)
* [Use C# 8.0 null-coalescing operator](https://github.com/akkadotnet/akka.net/pull/6814)

__Update dependency versions:__
* [Bump Google.Protobuf to 3.23.4](https://github.com/akkadotnet/akka.net/pull/6826)
* [Bump Akka.MultiNode.TestAdapter to 1.5.8](https://github.com/akkadotnet/akka.net/pull/6802)
* [Bump Microsoft.Data.SQLite to 7.0.9](https://github.com/akkadotnet/akka.net/pull/6835)
* [Bump Microsoft.Extensions.ObjectPool to 7.0.8](https://github.com/akkadotnet/akka.net/pull/6813)
* [Bump Xunit to 2.5.0](https://github.com/akkadotnet/akka.net/pull/6825)

__Akka.TestKit.Xunit Changes__

Due to breaking API change in Xunit 2.5.0, updating to Akka.NET 1.5.9 might break your unit tests. Some of the breaking change that we've noticed are:

* `AkkaEqualException` constructor has been changed due to changes in Xunit API. If you're using this class, please use the `AkkaEqualException.ForMismatchedValues()` static method instead of using the constructor.
* Testing for exception types by calling async code inside a sync delegate will not unwrap the `AggregateException` thrown. Either use async all the way or manually unwrap the exception.
* Xunit `Asset.Equal()` does not automatically check for collection item equality anymore, that means doing `Assert.Equal()` between two dictionary or list would not work anymore.
* Some Xunit classes have been changed from public to private. If you're using these classes, you will need to refactor your code.
* __FsCheck.Xunit:__ Xunit Roslyn analyzer has become a bit too overzealous and insists that all unit test method can only return either void or Task and will raise a compilation error if you tried to return anything else. If you're using `FsCheck.Xunit`, you will need to use a pragma to disable this check: `#pragma warning disable xUnit1028`.

If you want to see the [full set of changes made in Akka.NET v1.5.9, click here](https://github.com/akkadotnet/akka.net/milestone/91?closed=1).

| COMMITS | LOC+ | LOC- | AUTHOR |
|---------|------|------|---------------------|
| 12 | 171 | 155 | dependabot[bot] |
| 7 | 466 | 165 | Aaron Stannard |
| 4 | 1648 | 1725 | Simon Cropp |
| 1 | 9 | 4 | Gregorius Soedharmo |
| 1 | 7 | 1 | Michael Buck |

#### 1.5.8 June 15th 2023 ####

Akka.NET v1.5.8 is a maintenance release that introduces some new features and fixes some bugs with Akka.NET v1.5.7 and earlier.

* [Akka.Streams: Added `Source`/`Flow` `Setup` operator](https://github.com/akkadotnet/akka.net/pull/6788)
* [Akka.Cluster.Sharding: fixed potential wire format problem when upgrading from v1.4 to v1.5 with `state-store-mode=ddata` and `remember-entities=on`](https://github.com/akkadotnet/akka.net/issues/6704)
* [Akka.Remote.TestKit: Fix MNTR crashing because it is using PolyFill extension method](https://github.com/akkadotnet/akka.net/pull/6768)

If you want to see the [full set of changes made in Akka.NET v1.5.8, click here](https://github.com/akkadotnet/akka.net/milestone/90?closed=1).

| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 9 | 11 | 11 | dependabot[bot] |
| 2 | 8 | 0 | Aaron Stannard |
| 2 | 75 | 4 | Gregorius Soedharmo |
| 2 | 132 | 158 | Simon Cropp |
| 1 | 431 | 1 | Ismael Hamed |
| 1 | 1 | 1 | Andrea Di Stefano |

#### 1.5.7 May 17th 2023 ####

Expand Down
2 changes: 1 addition & 1 deletion docs/articles/configuration/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Other parts of Akka.NET in the future, such as its dependency injection system,

So what if we want to use some built-in `Setup` types in combination with an `ActorSystem`? How do we work with these new types?

First, if we have HOCON that we need to pass into our `ActorSystem` still then we must use the [`BootstrapSetup` class]((xref:Akka.Actor.BootstrapSetup) to store our HOCON `Config`:
First, if we have HOCON that we need to pass into our `ActorSystem` still then we must use the [`BootstrapSetup` class](xref:Akka.Actor.BootstrapSetup) to store our HOCON `Config`:

[!code-csharp[SerializationSetup](../../../src/core/Akka.Docs.Tests/Configuration/SerializationSetupDocSpec.cs?name=MergedSetup)]

Expand Down
14 changes: 14 additions & 0 deletions docs/articles/streams/builtinstages.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,13 @@ Combine the elements of multiple streams into a stream of sequences using a comb

**completes** when any upstream completes

### Setup

Defer the creation of a `Source` until materialization and access `ActorMaterializer` and `Attributes`.

Typically used when access to materializer is needed to run a different stream during the construction of a source/flow.
Can also be used to access the underlying `ActorSystem` from `ActorMaterializer`.

## Sink Stages

These built-in sinks are available from ``Akka.Stream.DSL.Sink``:
Expand Down Expand Up @@ -615,6 +622,13 @@ Just like `Scan` but receiving a function that results in a `Task` to the next v

**completes** when upstream completes and the last `Task` is resolved

### Setup

Defer the creation of a `Flow` until materialization and access `ActorMaterializer` and `Attributes`.

Typically used when access to materializer is needed to run a different stream during the construction of a source/flow.
Can also be used to access the underlying `ActorSystem` from `ActorMaterializer`.

### Aggregate

Start with current value ``zero`` and then apply the current and next value to the given function, when upstream
Expand Down
2 changes: 2 additions & 0 deletions src/Akka.sln
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Akka.sln.DotSettings = Akka.sln.DotSettings
NuGet.Config = NuGet.Config
Directory.Build.props = Directory.Build.props
..\README.md = ..\README.md
..\RELEASE_NOTES.md = ..\RELEASE_NOTES.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Akka.Remote.Tests.MultiNode", "core\Akka.Remote.Tests.MultiNode\Akka.Remote.Tests.MultiNode.csproj", "{C9105C76-B084-4DA1-9348-1C74A8F22F6B}"
Expand Down
14 changes: 7 additions & 7 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@
<LangVersion>11.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.2</XunitVersion>
<XunitRunnerVersion>2.4.2</XunitRunnerVersion>
<TestSdkVersion>17.6.0</TestSdkVersion>
<XunitVersion>2.5.0</XunitVersion>
<XunitRunnerVersion>2.5.0</XunitRunnerVersion>
<TestSdkVersion>17.6.3</TestSdkVersion>
<HyperionVersion>0.12.2</HyperionVersion>
<NewtonsoftJsonVersion>[13.0.1,)</NewtonsoftJsonVersion>
<NBenchVersion>2.0.1</NBenchVersion>
<ProtobufVersion>3.23.2</ProtobufVersion>
<BenchmarkDotNetVersion>0.13.2</BenchmarkDotNetVersion>
<ProtobufVersion>3.23.4</ProtobufVersion>
<BenchmarkDotNetVersion>0.13.6</BenchmarkDotNetVersion>
<NetTestVersion>net7.0</NetTestVersion>
<FsharpVersion>6.0.5</FsharpVersion>
<NetFrameworkTestVersion>net471</NetFrameworkTestVersion>
<NetStandardLibVersion>netstandard2.0</NetStandardLibVersion>
<NetLibVersion>net6.0</NetLibVersion>
<FluentAssertionsVersion>5.10.3</FluentAssertionsVersion>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<FsCheckVersion>2.16.5</FsCheckVersion>
<FsCheckVersion>2.16.6</FsCheckVersion>
<HoconVersion>2.0.3</HoconVersion>
<ConfigurationManagerVersion>6.0.1</ConfigurationManagerVersion>
<MultiNodeAdapterVersion>1.5.6</MultiNodeAdapterVersion>
<MultiNodeAdapterVersion>1.5.8</MultiNodeAdapterVersion>
<MicrosoftLibVersion>5.0.0</MicrosoftLibVersion>
<AkkaPackageTags>akka;actors;actor model;Akka;concurrency</AkkaPackageTags>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
namespace Akka.Benchmarks.Actor
{
[Config(typeof(MicroBenchmarkConfig))]
[SimpleJob(RunStrategy.Monitoring, targetCount: 25, warmupCount: 5)]
[SimpleJob(RunStrategy.Monitoring, warmupCount: 5)]
public class ActorMemoryFootprintBenchmark
{
public ActorSystem Sys;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ActorMessagingMemoryPressureBenchmark
public sealed class StopActor
{
private StopActor(){}
public static readonly StopActor Instance = new StopActor();
public static readonly StopActor Instance = new();
}

public sealed class MyActor : ReceiveActor
Expand Down
4 changes: 2 additions & 2 deletions src/benchmark/Akka.Benchmarks/Actor/ActorPathBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class ActorPathBenchmarks
private ActorPath x;
private ActorPath y;
private ActorPath _childPath;
private Address _sysAdr = new Address("akka.tcp", "system", "127.0.0.1", 1337);
private Address _otherAdr = new Address("akka.tcp", "system", "127.0.0.1", 1338);
private Address _sysAdr = new("akka.tcp", "system", "127.0.0.1", 1337);
private Address _otherAdr = new("akka.tcp", "system", "127.0.0.1", 1338);

private string _actorPathStr;

Expand Down
10 changes: 5 additions & 5 deletions src/benchmark/Akka.Benchmarks/Actor/GetChildBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ protected override void OnReceive(object message)
private ActorSystem _system;
private IActorRef _parentActor;

private ActorWithChild.Get _getMessage = new ActorWithChild.Get("food");
private ActorWithChild.Create _createMessage = new ActorWithChild.Create("food");
private ActorWithChild.Get _getMessage = new("food");
private ActorWithChild.Create _createMessage = new("food");

private IActorContext _cell;
private RepointableActorRef _repointableActorRef;
private LocalActorRef _localActorRef;
private VirtualPathContainer _virtualPathContainer;

private List<string> _rpChildQueryPath = new List<string>() { "food", "ood", "od" };
private List<string> _lclChildQueryPath = new List<string>() { "ood", "od", "d" };
private List<string> _virtualPathContainerQueryPath = new List<string>() { "foo" };
private List<string> _rpChildQueryPath = new() { "food", "ood", "od" };
private List<string> _lclChildQueryPath = new() { "ood", "od", "d" };
private List<string> _virtualPathContainerQueryPath = new() { "foo" };

[GlobalSetup]
public async Task Setup()
Expand Down
12 changes: 6 additions & 6 deletions src/benchmark/Akka.Benchmarks/Actor/PingPongBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
namespace Akka.Benchmarks.Actor
{
[Config(typeof(MonitoringConfig))]
[SimpleJob(RunStrategy.Monitoring, launchCount: 3, warmupCount: 3, targetCount: 3)]
[SimpleJob(RunStrategy.Monitoring, launchCount: 10, warmupCount: 10)]
public class PingPongBenchmarks
{
public const int Operations = 1_000_000;
private TimeSpan timeout;
private ActorSystem system;
private IActorRef ping;

[GlobalSetup]
[IterationSetup]
public void Setup()
{
timeout = TimeSpan.FromMinutes(1);
Expand All @@ -33,13 +33,13 @@ public void Setup()
ping = system.ActorOf(Props.Create(() => new Ping(pong)));
}

[GlobalCleanup]
[IterationCleanup]
public void Cleanup()
{
system.Dispose();
}

[Benchmark(OperationsPerInvoke = Operations)]
[Benchmark(OperationsPerInvoke = Operations * 2)]
public async Task Actor_ping_pong_single_pair_in_memory()
{
await ping.Ask(StartTest.Instance, timeout);
Expand All @@ -49,7 +49,7 @@ public async Task Actor_ping_pong_single_pair_in_memory()

sealed class StartTest
{
public static readonly StartTest Instance = new StartTest();
public static readonly StartTest Instance = new();
private StartTest() { }
}

Expand All @@ -65,7 +65,7 @@ public Signal(int remaining)

sealed class TestDone
{
public static readonly TestDone Instance = new TestDone();
public static readonly TestDone Instance = new();
private TestDone() { }
}

Expand Down
6 changes: 3 additions & 3 deletions src/benchmark/Akka.Benchmarks/Actor/SpawnActorBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
namespace Akka.Benchmarks.Actor
{
[Config(typeof(MicroBenchmarkConfig))]
[SimpleJob(RunStrategy.Throughput, targetCount:10, warmupCount:5)]
[SimpleJob(RunStrategy.Throughput, warmupCount:5)]
public class SpawnActorBenchmarks
{
[Params(100_000)]
Expand Down Expand Up @@ -66,13 +66,13 @@ public StartTest(int actorCount) {

sealed class ChildReady
{
public static readonly ChildReady Instance = new ChildReady();
public static readonly ChildReady Instance = new();
private ChildReady() { }
}

sealed class TestDone
{
public static readonly TestDone Instance = new TestDone();
public static readonly TestDone Instance = new();
private TestDone() { }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class ReachabilityBenchmarks
[Params(100)]
public int Iterations;

public Address Address = new Address("akka", "sys", "a", 2552);
public Address Node = new Address("akka", "sys", "a", 2552);
public Address Address = new("akka", "sys", "a", 2552);
public Address Node = new("akka", "sys", "a", 2552);

private Reachability CreateReachabilityOfSize(Reachability baseReachability, int size)
{
Expand Down
42 changes: 39 additions & 3 deletions src/benchmark/Akka.Benchmarks/Configurations/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,57 @@
// </copyright>
//-----------------------------------------------------------------------

using System.Reflection;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Columns;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using BenchmarkDotNet.Exporters;
using BenchmarkDotNet.Loggers;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;

namespace Akka.Benchmarks.Configurations
{
public class RequestsPerSecondColumn : IColumn
{
public string Id => nameof(RequestsPerSecondColumn);
public string ColumnName => "Req/sec";

public bool IsDefault(Summary summary, BenchmarkCase benchmarkCase) => false;
public string GetValue(Summary summary, BenchmarkCase benchmarkCase) => GetValue(summary, benchmarkCase, null);
public bool IsAvailable(Summary summary) => true;
public bool AlwaysShow => true;
public ColumnCategory Category => ColumnCategory.Custom;
public int PriorityInCategory => -1;
public bool IsNumeric => true;
public UnitType UnitType => UnitType.Dimensionless;
public string Legend => "Requests per Second";

public string GetValue(Summary summary, BenchmarkCase benchmarkCase, SummaryStyle style)
{
var benchmarkAttribute = benchmarkCase.Descriptor.WorkloadMethod.GetCustomAttribute<BenchmarkAttribute>();
var totalOperations = benchmarkAttribute?.OperationsPerInvoke ?? 1;

var report = summary[benchmarkCase];
var nsPerOperation = report.ResultStatistics.Mean;
var operationsPerSecond = 1 / (nsPerOperation / 1e9);


return operationsPerSecond.ToString("N2"); // or format as you like
}
}


/// <summary>
/// Basic BenchmarkDotNet configuration used for microbenchmarks.
/// </summary>
public class MicroBenchmarkConfig : ManualConfig
{
public MicroBenchmarkConfig()
{
this.Add(MemoryDiagnoser.Default);
this.Add(MarkdownExporter.GitHub);
AddDiagnoser(MemoryDiagnoser.Default);
AddExporter(MarkdownExporter.GitHub);
AddLogger(ConsoleLogger.Default);
}
}
Expand All @@ -32,7 +67,8 @@ public class MonitoringConfig : ManualConfig
{
public MonitoringConfig()
{
this.Add(MarkdownExporter.GitHub);
AddExporter(MarkdownExporter.GitHub);
AddColumn(new RequestsPerSecondColumn());
}
}
}
4 changes: 2 additions & 2 deletions src/benchmark/Akka.Benchmarks/IO/TcpOperationsBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace Akka.Benchmarks
{
[Config(typeof(MicroBenchmarkConfig))]
[SimpleJob(warmupCount: 1, invocationCount: 1, launchCount: 1, runStrategy: RunStrategy.Monitoring, targetCount: 100)]
[SimpleJob(warmupCount: 1, invocationCount: 1, launchCount: 1, runStrategy: RunStrategy.Monitoring)]
public class TcpOperationsBenchmarks
{
private ActorSystem _system;
Expand Down Expand Up @@ -104,7 +104,7 @@ public EchoConnection(IActorRef connection)

private class ClientCoordinator : ReceiveActor
{
private readonly HashSet<IActorRef> _waitingChildren = new HashSet<IActorRef>();
private readonly HashSet<IActorRef> _waitingChildren = new();
private IActorRef _requester;

public ClientCoordinator(string host, int port, int clientsCount)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class AkkaPduCodecBenchmark
/// </summary>
private readonly object _message = "foobar";

private readonly Ack _lastAck = new Ack(-1);
private readonly Ack _lastAck = new(-1);

private ByteString _fullDecode;
private ByteString _pduDecoded;
Expand Down
Loading

0 comments on commit 64509e2

Please sign in to comment.