Skip to content

Commit

Permalink
Merge pull request #4037 from Aaronontheweb/v1.3.16-rebase
Browse files Browse the repository at this point in the history
V1.3.16 Release
  • Loading branch information
Aaronontheweb authored Nov 14, 2019
2 parents 537f818 + 869ec84 commit 58d7b9b
Show file tree
Hide file tree
Showing 27 changed files with 796 additions and 175 deletions.
22 changes: 16 additions & 6 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
#### 1.3.15 September 23 2019 ####
#### 1.3.16 November 14 2019 ####
**Maintenance Release for Akka.NET 1.3**

1.3.15 consists of non-breaking bugfixes and additions that have been contributed against the [Akka.NET v1.4.0 milestone](https://github.com/akkadotnet/akka.net/milestone/17) thus far.
1.3.16 consists of non-breaking bugfixes and additions that have been contributed against the [Akka.NET v1.4.0 milestone](https://github.com/akkadotnet/akka.net/milestone/17) thus far.

This really only includes one major fix: [a major issue with Akka.Remote, which caused unnecessary `Quarantine` events](https://github.com/akkadotnet/akka.net/issues/3905).
This patch includes some small fixes, such as:

We highly recommend upgrading to this build if you're using Akka.Remote or Akka.Cluster.
* [fix: NuGet symbols not published](https://github.com/akkadotnet/akka.net/pull/3966)
* [Akka.Cluster.Sharding: Consolidated passivation check on settings used in region and shard](https://github.com/akkadotnet/akka.net/pull/3961)
* [Akka.Cluster.Tools: Singleton - missing state change fix](https://github.com/akkadotnet/akka.net/pull/4003)
* [Akka.Cluster.Tools: Fixed singleton issue when leaving several nodes](https://github.com/akkadotnet/akka.net/pull/3962)

To [see the full set of changes in Akka.NET v1.3.15, click here](https://github.com/akkadotnet/akka.net/pull/3931).
However, the biggest fix is for .NET Core 3.0 users. When .NET Core 3.0 was introduced, it broke some of the APIs in prior versions of [Hyperion](https://github.com/akkadotnet/Hyperion) which subsequently caused Akka.Cluster.Sharding and Akka.DistributedData users to have problems when attempting to run on .NET Core 3.0. These have been fixed as Akka.NET v1.3.16 is now running using the latest versions of Hyperion, which resolve this issue.

To [see the full set of changes in Akka.NET v1.3.16, click here](https://github.com/akkadotnet/akka.net/pull/4037).

| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 3 | 443 | 196 | Aaron Stannard |
| 4 | 119 | 6 | Aaron Stannard |
| 3 | 531 | 126 | Ismael Hamed |
| 3 | 108 | 11 | Andre Loker |
| 2 | 2 | 2 | dependabot-preview[bot] |
| 1 | 6 | 1 | cptjazz |
| 1 | 1 | 1 | zbynek001 |
2 changes: 1 addition & 1 deletion build-system/windows-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ steps:
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'nuget nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'
arguments: 'nuget nugetpublishurl=https://api.nuget.org/v3/index.json nugetkey=$(nugetKey)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
Expand Down
15 changes: 6 additions & 9 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ Target "CreateNuget" (fun _ ->
{ p with
Project = project
Configuration = configuration
AdditionalArgs = ["--include-symbols --no-build"]
AdditionalArgs = ["--include-symbols"]
VersionSuffix = versionSuffix
OutputPath = outputNuGet })

Expand Down Expand Up @@ -512,17 +512,15 @@ Target "PublishNuget" (fun _ ->
if (shouldPushNugetPackages || shouldPushSymbolsPackages) then
printfn "Pushing nuget packages"
if shouldPushNugetPackages then
let normalPackages=
!! (outputNuGet @@ "*.nupkg")
-- (outputNuGet @@ "*.symbols.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
let normalPackages= !! (outputNuGet @@ "*.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
for package in normalPackages do
try
publishPackage (getBuildParamOrDefault "nugetpublishurl" "") (getBuildParam "nugetkey") 3 package
publishPackage (getBuildParamOrDefault "nugetpublishurl" "https://api.nuget.org/v3/index.json") (getBuildParam "nugetkey") 3 package
with exn ->
printfn "%s" exn.Message

if shouldPushSymbolsPackages then
let symbolPackages= !! (outputNuGet @@ "*.symbols.nupkg") |> Seq.sortBy(fun x -> x.ToLower())
let symbolPackages= !! (outputNuGet @@ "*.snupkg") |> Seq.sortBy(fun x -> x.ToLower())
for package in symbolPackages do
try
publishPackage (getBuildParam "symbolspublishurl") (getBuildParam "symbolskey") 3 package
Expand Down Expand Up @@ -627,14 +625,13 @@ Target "Help" <| fun _ ->
Target "HelpNuget" <| fun _ ->
List.iter printfn [
"usage: "
"build Nuget [nugetkey=<key> [nugetpublishurl=<url>]] "
" [symbolspublishurl=<url>] "
"build Nuget [nugetkey=<key> [nugetpublishurl=<url>]] [symbolskey=<key> symbolspublishurl=<url>]"
""
"In order to publish a nuget package, keys must be specified."
"If a key is not specified the nuget packages will only be created on disk"
"After a build you can find them in build/nuget"
""
"For pushing nuget packages to nuget.org and symbols to symbolsource.org"
"For pushing nuget packages and symbols to nuget.org"
"you need to specify nugetkey=<key>"
" build Nuget nugetKey=<key for nuget.org>"
""
Expand Down
43 changes: 17 additions & 26 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<Copyright>Copyright © 2013-2019 Akka.NET Team</Copyright>
<Authors>Akka.NET Team</Authors>
<VersionPrefix>1.4.0</VersionPrefix>
<VersionPrefix>1.3.16</VersionPrefix>
<PackageIconUrl>http://getakka.net/images/akkalogo.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/akkadotnet/akka.net</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/akkadotnet/akka.net/blob/master/LICENSE</PackageLicenseUrl>
Expand All @@ -11,7 +11,7 @@
<PropertyGroup>
<XunitVersion>2.3.1</XunitVersion>
<TestSdkVersion>15.9.0</TestSdkVersion>
<HyperionVersion>0.9.8</HyperionVersion>
<HyperionVersion>0.9.11</HyperionVersion>
<NewtonsoftJsonVersion>9.0.1</NewtonsoftJsonVersion>
<NBenchVersion>1.2.2</NBenchVersion>
<ProtobufVersion>3.9.1</ProtobufVersion>
Expand All @@ -27,32 +27,23 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup>
<PackageReleaseNotes>Second pre-release candidate for Akka.NET 1.4**
Akka.NET v1.4.0 is still moving along and this release contains some new and important changes.
We've added a new package, the Akka.Persistence.TestKit - this is designed to allow users to test their `PersistentActor` implementations under real-world conditions such as database connection failures, serialization errors, and so forth. It works alongside the standard Akka.NET TestKit distributions and offers a simple, in-place API to do so.
Akka.Streams now supports [Stream Context propagation](https://github.com/akkadotnet/akka.net/pull/3741), designed to make it really easy to work with tools such as Kafka, Amazon SQS, and more - where you might want to have one piece of context (such as the partition offset in Kafka) and propagate it from the very front of an Akka.Stream all the way to the end, and then finally process it once the rest of the stream has completed processing. In the case of Kakfa, this might be updating the local consumer's partition offset only once we've been able to fully guarantee the processing of the message.
Fixed
To [follow our progress on the Akka.NET v1.4 milestone, click here](https://github.com/akkadotnet/akka.net/milestone/17).
We expect to release more beta versions in the future, and if you wish to [get access to nightly Akka.NET builds then click here](https://getakka.net/community/getting-access-to-nightly-builds.html).
<PackageReleaseNotes>Maintenance Release for Akka.NET 1.3**
1.3.16 consists of non-breaking bugfixes and additions that have been contributed against the [Akka.NET v1.4.0 milestone](https://github.com/akkadotnet/akka.net/milestone/17) thus far.
This patch includes some small fixes, such as:
[fix: NuGet symbols not published](https://github.com/akkadotnet/akka.net/pull/3966)
[Akka.Cluster.Sharding: Consolidated passivation check on settings used in region and shard](https://github.com/akkadotnet/akka.net/pull/3961)
[Akka.Cluster.Tools: Singleton - missing state change fix](https://github.com/akkadotnet/akka.net/pull/4003)
[Akka.Cluster.Tools: Fixed singleton issue when leaving several nodes](https://github.com/akkadotnet/akka.net/pull/3962)
However, the biggest fix is for .NET Core 3.0 users. When .NET Core 3.0 was introduced, it broke some of the APIs in prior versions of [Hyperion](https://github.com/akkadotnet/Hyperion) which subsequently caused Akka.Cluster.Sharding and Akka.DistributedData users to have problems when attempting to run on .NET Core 3.0. These have been fixed as Akka.NET v1.3.16 is now running using the latest versions of Hyperion, which resolve this issue.
To [see the full set of changes in Akka.NET v1.3.16, click here](https://github.com/akkadotnet/akka.net/pull/4037).
| COMMITS | LOC+ | LOC- | AUTHOR |
| --- | --- | --- | --- |
| 97 | 6527 | 3729 | Aaron Stannard |
| 13 | 11671 | 1059 | Bartosz Sypytkowski |
| 4 | 1708 | 347 | zbynek001 |
| 2 | 7 | 7 | jdsartori |
| 2 | 4 | 6 | Onur Gumus |
| 2 | 37 | 114 | Ismael Hamed |
| 1 | 65 | 47 | Ondrej Pialek |
| 1 | 3020 | 2 | Valdis Zobēla |
| 1 | 3 | 3 | Abi |
| 1 | 3 | 1 | jg11jg |
| 1 | 18 | 16 | Peter Huang |
| 1 | 1 | 2 | Maciej Wódke |
| 1 | 1 | 1 | Wessel Kranenborg |
| 1 | 1 | 1 | Kaiwei Li |
| 1 | 1 | 1 | Greatsamps |
| 1 | 1 | 1 | Arjen Smits |
| 1 | 1 | 1 | Andre |</PackageReleaseNotes>
| 4 | 119 | 6 | Aaron Stannard |
| 3 | 531 | 126 | Ismael Hamed |
| 3 | 108 | 11 | Andre Loker |
| 2 | 2 | 2 | dependabot-preview[bot] |
| 1 | 6 | 1 | cptjazz |
| 1 | 1 | 1 | zbynek001 |</PackageReleaseNotes>
</PropertyGroup>
<!-- SourceLink support for all Akka.NET projects -->
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Akka.Actor;
using Akka.Cluster.Tools.Singleton;
using Akka.Configuration;
using Akka.TestKit.TestActors;
using FluentAssertions;
using Xunit;

Expand Down Expand Up @@ -80,28 +79,28 @@ public void ClusterSharding_must_start_a_region_in_proxy_mode_in_case_of_node_ro
}

[Fact]
public void HandOffStopper_must_stop_the_entity_even_if_the_entity_doesnt_handle_handOffStopMessage()
public void ClusterSharding_must_stop_entities_from_HandOffStopper_even_if_the_entity_doesnt_handle_handOffStopMessage()
{

var probe = CreateTestProbe();
var shardName = "test";
var emptyHandlerActor = Sys.ActorOf(Props.Create(() => new EmptyHandlerActor()));
var handOffStopper = Sys.ActorOf(
Props.Create(() => new ShardRegion.HandOffStopper(shardName, probe.Ref, new IActorRef[] { emptyHandlerActor }, HandOffStopMessage.Instsnce, TimeSpan.FromMilliseconds(10)))
Props.Create(() => new ShardRegion.HandOffStopper(shardName, probe.Ref, new IActorRef[] { emptyHandlerActor }, HandOffStopMessage.Instance, TimeSpan.FromMilliseconds(10)))
);

Watch(emptyHandlerActor);
ExpectTerminated(emptyHandlerActor, TimeSpan.FromSeconds(1));

probe.ExpectMsg(new PersistentShardCoordinator.ShardStopped(shardName), TimeSpan.FromSeconds(1));
probe.LastSender.Should().BeSameAs(handOffStopper);

Watch(handOffStopper);
ExpectTerminated(handOffStopper, TimeSpan.FromSeconds(1));
}

internal class HandOffStopMessage : INoSerializationVerificationNeeded
{
public static readonly HandOffStopMessage Instsnce = new HandOffStopMessage();
public static readonly HandOffStopMessage Instance = new HandOffStopMessage();
private HandOffStopMessage()
{
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//-----------------------------------------------------------------------
// <copyright file="ClusterShardingConfigSpec.cs" company="Akka.NET Project">
// Copyright (C) 2009-2019 Lightbend Inc. <http://www.lightbend.com>
// Copyright (C) 2013-2019 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
//-----------------------------------------------------------------------

using System;
using Akka.Cluster.Tools.Singleton;
using Akka.Configuration;
using Akka.TestKit;
using Xunit;

namespace Akka.Cluster.Sharding.Tests
{
public class ClusterShardingSettingsSpec : Akka.TestKit.Xunit2.TestKit
{
public ClusterShardingSettingsSpec()
: base(GetConfig())
{ }

public static Config GetConfig()
{
return ConfigurationFactory.ParseString(@"akka.actor.provider = cluster
akka.remote.dot-netty.tcp.port = 0")
.WithFallback(ClusterSharding.DefaultConfig())
.WithFallback(ClusterSingletonManager.DefaultConfig());
}

[Fact]
public void ClusterShardingSettingsSpec_must_passivate_idle_entities_if_RememberEntities_and_PassivateIdleEntityAfter_are_the_defaults()
{
ClusterShardingSettings.Create(Sys).ShouldPassivateIdleEntities.ShouldBe(true);
}

[Fact]
public void ClusterShardingSettingsSpec_should_disable_passivation_if_RememberEntities_is_enabled()
{
ClusterShardingSettings.Create(Sys)
.WithRememberEntities(true)
.ShouldPassivateIdleEntities.ShouldBe(false);
}

[Fact]
public void ClusterShardingSettingsSpec_should_disable_passivation_if_RememberEntities_is_enabled_and_PassivateIdleEntityAfter_is_0_or_off()
{
ClusterShardingSettings.Create(Sys)
.WithRememberEntities(true)
.WithPassivateIdleAfter(TimeSpan.Zero)
.ShouldPassivateIdleEntities.ShouldBe(false);
}

[Fact]
public void ClusterShardingSettingsSpec_should_disable_passivation_if_RememberEntities_is_the_default_and_PassivateIdleEntityAfter_is_0_or_off()
{
ClusterShardingSettings.Create(Sys).WithPassivateIdleAfter(TimeSpan.Zero).ShouldPassivateIdleEntities.ShouldBe(false);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,11 @@ internal bool ShouldHostShard(Cluster cluster)
return string.IsNullOrEmpty(Role) || cluster.SelfRoles.Contains(Role);
}

/// <summary>
/// If true, idle entities should be passivated if they have not received any message by this interval, otherwise it is not enabled.
/// </summary>
internal bool ShouldPassivateIdleEntities => PassivateIdleEntityAfter > TimeSpan.Zero && !RememberEntities;

/// <summary>
/// TBD
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/cluster/Akka.Cluster.Sharding/DDataShard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public DDataShard(
: EntityRecoveryStrategy.AllStrategy;

var idleInterval = TimeSpan.FromTicks(Settings.PassivateIdleEntityAfter.Ticks / 2);
PassivateIdleTask = Settings.PassivateIdleEntityAfter > TimeSpan.Zero && !Settings.RememberEntities
PassivateIdleTask = Settings.ShouldPassivateIdleEntities
? Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(idleInterval, idleInterval, Self, Shard.PassivateIdleTick.Instance, Self)
: null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public PersistentShard(
: EntityRecoveryStrategy.AllStrategy;

var idleInterval = TimeSpan.FromTicks(Settings.PassivateIdleEntityAfter.Ticks / 2);
PassivateIdleTask = Settings.PassivateIdleEntityAfter > TimeSpan.Zero && !Settings.RememberEntities
PassivateIdleTask = Settings.ShouldPassivateIdleEntities
? Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(idleInterval, idleInterval, Self, Shard.PassivateIdleTick.Instance, Self)
: null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/contrib/cluster/Akka.Cluster.Sharding/Shard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public Shard(
: EntityRecoveryStrategy.AllStrategy;

var idleInterval = TimeSpan.FromTicks(Settings.PassivateIdleEntityAfter.Ticks / 2);
PassivateIdleTask = Settings.PassivateIdleEntityAfter > TimeSpan.Zero && !Settings.RememberEntities
PassivateIdleTask = Settings.ShouldPassivateIdleEntities
? Context.System.Scheduler.ScheduleTellRepeatedlyCancelable(idleInterval, idleInterval, Self, PassivateIdleTick.Instance, Self)
: null;

Expand Down
14 changes: 10 additions & 4 deletions src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,7 @@ protected object RegistrationMessage
protected override void PreStart()
{
Cluster.Subscribe(Self, typeof(ClusterEvent.IMemberEvent));
if (Settings.PassivateIdleEntityAfter > TimeSpan.Zero && !Settings.RememberEntities)
{
Log.Info($"Idle entities will be passivated after [{Settings.PassivateIdleEntityAfter}]");
}
LogPassivateIdleEntities();
}

/// <inheritdoc cref="ActorBase.PostStop"/>
Expand All @@ -469,6 +466,15 @@ protected override void PostStop()
_retryTask.Cancel();
}

private void LogPassivateIdleEntities()
{
if (Settings.ShouldPassivateIdleEntities)
Log.Info($"{TypeName}: Idle entities will be passivated after [{Settings.PassivateIdleEntityAfter}]");

if (Settings.RememberEntities)
Log.Debug("Idle entities will not be passivated because 'rememberEntities' is enabled.");
}

/// <summary>
/// TBD
/// </summary>
Expand Down
Loading

0 comments on commit 58d7b9b

Please sign in to comment.