From a43207dade5504a9cb60580b416214704c3daab1 Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 16 May 2019 17:16:49 +1000 Subject: [PATCH 01/13] Enable features that are now in the netstandard2.0 library set (but were missing from the 1.x library set). #3668 --- .../AsyncWriteProxyEx.cs | 2 - .../Akka.Cluster.Sharding.csproj | 4 - .../Akka.Cluster.Tools.csproj | 4 - .../Singleton/ClusterSingletonManager.cs | 2 - .../Akka.DistributedData.csproj | 4 - .../Akka.DistributedData/Durable/Messages.cs | 2 - .../Akka.DI.Core/Akka.DI.Core.csproj | 4 - .../Akka.DI.Core/Extensions.cs | 24 ------ .../Akka.DI.TestKit/Akka.DI.TestKit.csproj | 4 - .../Akka.Persistence.Query.Sql.csproj | 4 - .../Akka.Persistence.Sql.Common.csproj | 2 +- .../Akka.Persistence.Sql.TestKit.csproj | 4 - .../Akka.Serialization.Hyperion.csproj | 3 - .../Akka.Serialization.TestKit.csproj | 4 - .../Internals/AkkaEqualException.cs | 3 +- .../Internals/AkkaEqualException.cs | 3 +- .../Akka.Cluster.TestKit.csproj | 4 - src/core/Akka.Cluster/Akka.Cluster.csproj | 4 - .../Persistence/VisualizerRuntimeTemplate.cs | 4 - .../Sinks/ConsoleMessageSinkActor.cs | 3 - .../Sinks/SinkCoordinator.cs | 4 - .../Sinks/TeamCityMessageSinkActor.cs | 3 - .../Akka.MultiNodeTestRunner/Discovery.cs | 23 ----- .../Akka.Persistence.Query.csproj | 8 -- .../Akka.Persistence.TCK.csproj | 4 - .../Journal/JournalSpec.cs | 2 - .../Akka.Persistence/Akka.Persistence.csproj | 3 - .../AtLeastOnceDeliverySemantic.cs | 2 - .../Journal/AsyncWriteProxy.cs | 2 - src/core/Akka.Persistence/PersistentActor.cs | 2 - .../Snapshot/NoSnapshotStore.cs | 2 - .../Akka.Remote.TestKit.csproj | 5 -- src/core/Akka.Remote.TestKit/Controller.cs | 2 - .../Internals/TestConductorConfigFactory.cs | 4 - src/core/Akka.Remote.TestKit/MultiNodeSpec.cs | 6 -- .../Transport/DotNettySslSupportSpec.cs | 7 -- src/core/Akka.Remote/AckedDelivery.cs | 2 - src/core/Akka.Remote/Akka.Remote.csproj | 3 - src/core/Akka.Remote/Endpoint.cs | 2 - src/core/Akka.Remote/RemoteTransport.cs | 2 - .../Serialization/ExceptionSupport.cs | 85 ------------------- .../Akka.Remote/Transport/AkkaPduCodec.cs | 2 - .../Transport/AkkaProtocolTransport.cs | 2 - .../Transport/DotNetty/DotNettyTransport.cs | 2 - .../DotNetty/DotNettyTransportSettings.cs | 5 -- .../FailureInjectorTransportAdapter.cs | 2 - src/core/Akka.Remote/Transport/Transport.cs | 2 - .../Akka.Streams.TestKit.Tests.csproj | 2 +- .../ScriptedTest.cs | 3 - .../Akka.Streams.TestKit/TestSubscriber.cs | 17 +++- .../Akka.Streams.Tests.csproj | 4 +- src/core/Akka.Streams/ActorMaterializer.cs | 4 - src/core/Akka.Streams/Akka.Streams.csproj | 2 +- src/core/Akka.Streams/Dsl/Keep.cs | 16 ---- .../Implementation/ActorPublisher.cs | 2 - .../ReactiveStreamsCompliance.cs | 2 - .../ResizableMultiReaderRingBuffer.cs | 2 - .../Implementation/StreamLayout.cs | 2 - .../StreamSubscriptionTimeout.cs | 2 - src/core/Akka.Streams/OverflowStrategy.cs | 2 - src/core/Akka.Streams/Shape.cs | 5 +- src/core/Akka.Streams/Stage/GraphStage.cs | 2 - .../StreamLimitReachedException.cs | 2 - src/core/Akka.Streams/StreamTcpException.cs | 6 -- .../Akka.TestKit.Tests.csproj | 3 - .../Akka.Tests.Shared.Internals/AkkaSpec.cs | 6 +- .../Akka.Tests/Actor/Dispatch/Bug2640Spec.cs | 13 ++- src/core/Akka.Tests/Akka.Tests.csproj | 2 +- .../Akka.Tests/Pattern/CircuitBreakerSpec.cs | 2 - src/core/Akka/Actor/Address.cs | 5 +- src/core/Akka/Actor/CoordinatedShutdown.cs | 4 - src/core/Akka/Actor/Exceptions.cs | 26 ------ src/core/Akka/Actor/Props.cs | 7 +- .../Actor/Stash/StashOverflowException.cs | 2 - src/core/Akka/Akka.csproj | 2 +- .../Configuration/ConfigurationException.cs | 2 - src/core/Akka/Dispatch/AbstractDispatcher.cs | 4 +- .../Akka/Pattern/IllegalStateException.cs | 2 - src/core/Akka/Pattern/OpenCircuitException.cs | 2 - src/core/Akka/Routing/TailChopping.cs | 9 +- 80 files changed, 48 insertions(+), 394 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/AsyncWriteProxyEx.cs b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/AsyncWriteProxyEx.cs index 01f24380fe1..1f30e7ba60d 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/AsyncWriteProxyEx.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/AsyncWriteProxyEx.cs @@ -43,7 +43,6 @@ public AsyncReplayTimeoutException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -53,7 +52,6 @@ protected AsyncReplayTimeoutException(SerializationInfo info, StreamingContext c : base(info, context) { } -#endif } /// diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj b/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj index 625318a2204..b1e2b399856 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj +++ b/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj @@ -23,10 +23,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj b/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj index 5586e6802ff..609144005ad 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj +++ b/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs b/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs index e6fc0ea1daf..bb42167ec62 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools/Singleton/ClusterSingletonManager.cs @@ -423,7 +423,6 @@ public sealed class ClusterSingletonManagerIsStuckException : AkkaException /// The message that describes the error. public ClusterSingletonManagerIsStuckException(string message) : base(message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -432,7 +431,6 @@ public ClusterSingletonManagerIsStuckException(string message) : base(message) { public ClusterSingletonManagerIsStuckException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj b/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj index fc127771050..fbd26b98a55 100644 --- a/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj +++ b/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj @@ -20,10 +20,6 @@ - - $(DefineConstants);SERIALIZATION;CLONABLE - - $(DefineConstants);CORECLR diff --git a/src/contrib/cluster/Akka.DistributedData/Durable/Messages.cs b/src/contrib/cluster/Akka.DistributedData/Durable/Messages.cs index a8988ff4c2c..82adbae9d88 100644 --- a/src/contrib/cluster/Akka.DistributedData/Durable/Messages.cs +++ b/src/contrib/cluster/Akka.DistributedData/Durable/Messages.cs @@ -91,11 +91,9 @@ public LoadFailedException(string message, Exception cause) : base(message, caus { } -#if SERIALIZATION public LoadFailedException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } public sealed class DurableDataEnvelope : IReplicatorMessage, IEquatable diff --git a/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj b/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj index 3bc3ed189b9..874053b1272 100644 --- a/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj +++ b/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);APPDOMAIN - - $(DefineConstants);CORECLR diff --git a/src/contrib/dependencyinjection/Akka.DI.Core/Extensions.cs b/src/contrib/dependencyinjection/Akka.DI.Core/Extensions.cs index 0d7f577eb73..59982876b3f 100644 --- a/src/contrib/dependencyinjection/Akka.DI.Core/Extensions.cs +++ b/src/contrib/dependencyinjection/Akka.DI.Core/Extensions.cs @@ -11,9 +11,6 @@ using System.Reflection; using Akka.Actor; -#if CORECLR -using Microsoft.Extensions.DependencyModel; -#endif namespace Akka.DI.Core { /// @@ -78,28 +75,7 @@ public static Type GetTypeValue(this string typeName) /// The list of loaded assemblies private static IEnumerable GetLoadedAssemblies() { -#if APPDOMAIN return AppDomain.CurrentDomain.GetAssemblies(); -#elif CORECLR - var assemblies = new List(); - var dependencies = DependencyContext.Default.RuntimeLibraries; - foreach (var library in dependencies) - { - try - { - var assembly = Assembly.Load(new AssemblyName(library.Name)); - assemblies.Add(assembly); - } - catch - { - //do nothing can't if can't load assembly - } - } - return assemblies; -#else -#warning Method not implemented - throw new NotImplementedException(); -#endif } } } diff --git a/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj b/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj index 0313b37950a..c552232addc 100644 --- a/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj +++ b/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj @@ -15,10 +15,6 @@ - - $(DefineConstants);APPDOMAIN - - $(DefineConstants);CORECLR diff --git a/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj b/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj index 993a74ecd6a..c1c77c594b4 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj +++ b/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj @@ -22,10 +22,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj b/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj index ba0b5f1b957..57defd73acf 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj @@ -23,7 +23,7 @@ - $(DefineConstants);SERIALIZATION;CONFIGURATION + $(DefineConstants);CONFIGURATION diff --git a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj index d772d3538ac..4bc44a81487 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj +++ b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj @@ -16,10 +16,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj b/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj index a0917c8f475..43e275e82d1 100644 --- a/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj +++ b/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj @@ -21,9 +21,6 @@ - - $(DefineConstants);SERIALIZATION - $(DefineConstants);RELEASE diff --git a/src/contrib/serializers/Akka.Serialization.TestKit/Akka.Serialization.TestKit.csproj b/src/contrib/serializers/Akka.Serialization.TestKit/Akka.Serialization.TestKit.csproj index 7e406ff7f92..4411d160353 100644 --- a/src/contrib/serializers/Akka.Serialization.TestKit/Akka.Serialization.TestKit.csproj +++ b/src/contrib/serializers/Akka.Serialization.TestKit/Akka.Serialization.TestKit.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);RELEASE diff --git a/src/contrib/testkits/Akka.TestKit.Xunit/Internals/AkkaEqualException.cs b/src/contrib/testkits/Akka.TestKit.Xunit/Internals/AkkaEqualException.cs index 98846f12768..9494f4ce210 100644 --- a/src/contrib/testkits/Akka.TestKit.Xunit/Internals/AkkaEqualException.cs +++ b/src/contrib/testkits/Akka.TestKit.Xunit/Internals/AkkaEqualException.cs @@ -33,7 +33,6 @@ public AkkaEqualException(object expected, object actual, string format = "", pa _args = args; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -43,7 +42,7 @@ protected AkkaEqualException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif + /// /// The message that describes the error. /// diff --git a/src/contrib/testkits/Akka.TestKit.Xunit2/Internals/AkkaEqualException.cs b/src/contrib/testkits/Akka.TestKit.Xunit2/Internals/AkkaEqualException.cs index 6fedd250bd4..3f0a7e6899e 100644 --- a/src/contrib/testkits/Akka.TestKit.Xunit2/Internals/AkkaEqualException.cs +++ b/src/contrib/testkits/Akka.TestKit.Xunit2/Internals/AkkaEqualException.cs @@ -33,7 +33,6 @@ public AkkaEqualException(object expected, object actual, string format = "", pa _args = args; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -43,7 +42,7 @@ protected AkkaEqualException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif + /// /// The message that describes the error. /// diff --git a/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj b/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj index 39bc74e86e6..a8dfc31334e 100644 --- a/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj +++ b/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Cluster/Akka.Cluster.csproj b/src/core/Akka.Cluster/Akka.Cluster.csproj index 468ee344778..b3d5a37a3e8 100644 --- a/src/core/Akka.Cluster/Akka.Cluster.csproj +++ b/src/core/Akka.Cluster/Akka.Cluster.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Persistence/VisualizerRuntimeTemplate.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Persistence/VisualizerRuntimeTemplate.cs index 65eff8a3312..dc4a57c01c8 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Persistence/VisualizerRuntimeTemplate.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Persistence/VisualizerRuntimeTemplate.cs @@ -15,10 +15,6 @@ // // ------------------------------------------------------------------------------ -#if CORECLR -using Akka.MultiNodeTestRunner.Shared.Extensions; -#endif - namespace Akka.MultiNodeTestRunner.Shared.Persistence { using System.Linq; diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/ConsoleMessageSinkActor.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/ConsoleMessageSinkActor.cs index b3ebd390e2b..2574e96bd91 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/ConsoleMessageSinkActor.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/ConsoleMessageSinkActor.cs @@ -9,9 +9,6 @@ using System.Linq; using Akka.Actor; using Akka.Event; -#if CORECLR -using Akka.MultiNodeTestRunner.Shared.Extensions; -#endif using Akka.MultiNodeTestRunner.Shared.Reporting; namespace Akka.MultiNodeTestRunner.Shared.Sinks diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/SinkCoordinator.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/SinkCoordinator.cs index a792b7658d9..c2db173a3be 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/SinkCoordinator.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/SinkCoordinator.cs @@ -186,11 +186,7 @@ private void PublishToChildren(RunnerMessage message) { foreach (var sink in Sinks) { -#if CORECLR - sink.LogRunnerMessage(message.Message, Assembly.GetEntryAssembly().GetName().Name, LogLevel.InfoLevel); -#else sink.LogRunnerMessage(message.Message, Assembly.GetExecutingAssembly().GetName().Name, LogLevel.InfoLevel); -#endif } } diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/TeamCityMessageSinkActor.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/TeamCityMessageSinkActor.cs index c92b2872ba9..4bab2f6dbb4 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/TeamCityMessageSinkActor.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Sinks/TeamCityMessageSinkActor.cs @@ -13,9 +13,6 @@ using System.Threading.Tasks; using Akka.Actor; using Akka.Event; -#if CORECLR -using Akka.MultiNodeTestRunner.Shared.Extensions; -#endif using Akka.MultiNodeTestRunner.Shared.Reporting; using JetBrains.TeamCity.ServiceMessages; using JetBrains.TeamCity.ServiceMessages.Write.Special; diff --git a/src/core/Akka.MultiNodeTestRunner/Discovery.cs b/src/core/Akka.MultiNodeTestRunner/Discovery.cs index a50c6242781..d1836e21034 100644 --- a/src/core/Akka.MultiNodeTestRunner/Discovery.cs +++ b/src/core/Akka.MultiNodeTestRunner/Discovery.cs @@ -19,11 +19,7 @@ namespace Akka.MultiNodeTestRunner { -#if CORECLR - public class Discovery : IMessageSink, IDisposable -#else public class Discovery : MarshalByRefObject, IMessageSink, IDisposable -#endif { public Dictionary> Tests { get; set; } public List Errors { get; } = new List(); @@ -48,12 +44,8 @@ public virtual bool OnMessage(IMessageSinkMessage message) case ITestCaseDiscoveryMessage testCaseDiscoveryMessage: var testClass = testCaseDiscoveryMessage.TestClass.Class; if (testClass.IsAbstract) return true; -#if CORECLR - var specType = testCaseDiscoveryMessage.TestAssembly.Assembly.GetType(testClass.Name).ToRuntimeType(); -#else var testAssembly = Assembly.LoadFrom(testCaseDiscoveryMessage.TestAssembly.Assembly.AssemblyPath); var specType = testAssembly.GetType(testClass.Name); -#endif var roles = RoleNames(specType); var details = roles.Select((r, i) => new NodeTest @@ -106,20 +98,11 @@ internal static ConstructorInfo FindConfigConstructor(Type configUser) var current = configUser; while (current != null) { - -#if CORECLR - var ctorWithConfig = current - .GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) - .FirstOrDefault(c => null != c.GetParameters().FirstOrDefault(p => p.ParameterType.GetTypeInfo().IsSubclassOf(baseConfigType))); - - current = current.GetTypeInfo().BaseType; -#else var ctorWithConfig = current .GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) .FirstOrDefault(c => null != c.GetParameters().FirstOrDefault(p => p.ParameterType.IsSubclassOf(baseConfigType))); current = current.BaseType; -#endif if (ctorWithConfig != null) return ctorWithConfig; } @@ -131,15 +114,9 @@ private object[] ConfigConstructorParamValues(Type configType) var ctors = configType.GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); var empty = ctors.FirstOrDefault(c => !c.GetParameters().Any()); -#if CORECLR - return empty != null - ? new object[0] - : ctors.First().GetParameters().Select(p => p.ParameterType.GetTypeInfo().IsValueType ? Activator.CreateInstance(p.ParameterType) : null).ToArray(); -#else return empty != null ? new object[0] : ctors.First().GetParameters().Select(p => p.ParameterType.IsValueType ? Activator.CreateInstance(p.ParameterType) : null).ToArray(); -#endif } /// diff --git a/src/core/Akka.Persistence.Query/Akka.Persistence.Query.csproj b/src/core/Akka.Persistence.Query/Akka.Persistence.Query.csproj index 34a25046720..bdaaf117ee6 100644 --- a/src/core/Akka.Persistence.Query/Akka.Persistence.Query.csproj +++ b/src/core/Akka.Persistence.Query/Akka.Persistence.Query.csproj @@ -15,14 +15,6 @@ - - $(DefineConstants);SERIALIZATION - - - - $(DefineConstants) - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj b/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj index a05cdb233af..ba3c098b13d 100644 --- a/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj +++ b/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj @@ -17,10 +17,6 @@ - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs index 6f7f5f74aa4..6a93d1d0c80 100644 --- a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs +++ b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs @@ -262,7 +262,6 @@ public void Journal_should_not_reset_HighestSequenceNr_after_journal_cleanup() _receiverProbe.ExpectMsg(m => m.HighestSequenceNr == 5L); } -#if !CORECLR /// /// JSON serializer should fail on this /// @@ -309,6 +308,5 @@ public void Journal_optionally_may_reject_non_serializable_events() m.Persistent.WriterGuid.Equals(writerGuid) && m.Persistent.Payload.Equals("b-8")); } -#endif } } diff --git a/src/core/Akka.Persistence/Akka.Persistence.csproj b/src/core/Akka.Persistence/Akka.Persistence.csproj index 6fe17a89b4e..7231fa08a64 100644 --- a/src/core/Akka.Persistence/Akka.Persistence.csproj +++ b/src/core/Akka.Persistence/Akka.Persistence.csproj @@ -14,9 +14,6 @@ - - $(DefineConstants);SERIALIZATION - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Persistence/AtLeastOnceDeliverySemantic.cs b/src/core/Akka.Persistence/AtLeastOnceDeliverySemantic.cs index a5372c7da31..771b2174bb5 100644 --- a/src/core/Akka.Persistence/AtLeastOnceDeliverySemantic.cs +++ b/src/core/Akka.Persistence/AtLeastOnceDeliverySemantic.cs @@ -225,7 +225,6 @@ public MaxUnconfirmedMessagesExceededException(string message, Exception innerEx { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -234,7 +233,6 @@ public MaxUnconfirmedMessagesExceededException(string message, Exception innerEx protected MaxUnconfirmedMessagesExceededException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } #endregion diff --git a/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs b/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs index aafa188817c..0db91176a6e 100644 --- a/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs +++ b/src/core/Akka.Persistence/Journal/AsyncWriteProxy.cs @@ -37,7 +37,6 @@ public AsyncReplayTimeoutException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -47,7 +46,6 @@ protected AsyncReplayTimeoutException(SerializationInfo info, StreamingContext c : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Persistence/PersistentActor.cs b/src/core/Akka.Persistence/PersistentActor.cs index 084f00aca8a..528973a0286 100644 --- a/src/core/Akka.Persistence/PersistentActor.cs +++ b/src/core/Akka.Persistence/PersistentActor.cs @@ -136,7 +136,6 @@ public RecoveryTimedOutException(string message, Exception cause = null) : base( { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -145,7 +144,6 @@ public RecoveryTimedOutException(string message, Exception cause = null) : base( public RecoveryTimedOutException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Persistence/Snapshot/NoSnapshotStore.cs b/src/core/Akka.Persistence/Snapshot/NoSnapshotStore.cs index 32c1edd2c57..9a8a95c21a6 100644 --- a/src/core/Akka.Persistence/Snapshot/NoSnapshotStore.cs +++ b/src/core/Akka.Persistence/Snapshot/NoSnapshotStore.cs @@ -49,7 +49,6 @@ public NoSnapshotStoreException(string message, Exception innerException) : base { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -58,7 +57,6 @@ public NoSnapshotStoreException(string message, Exception innerException) : base protected NoSnapshotStoreException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj b/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj index 8d1fffd0b63..242b5616df6 100644 --- a/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj +++ b/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj @@ -23,11 +23,6 @@ - - - $(DefineConstants);SERIALIZATION - - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Remote.TestKit/Controller.cs b/src/core/Akka.Remote.TestKit/Controller.cs index 08a19d822b8..34c7f6177cc 100644 --- a/src/core/Akka.Remote.TestKit/Controller.cs +++ b/src/core/Akka.Remote.TestKit/Controller.cs @@ -98,7 +98,6 @@ public class ClientDisconnectedException : AkkaException /// The message that describes the error. public ClientDisconnectedException(string message) : base(message){} -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -107,7 +106,6 @@ public ClientDisconnectedException(string message) : base(message){} protected ClientDisconnectedException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } public class GetNodes diff --git a/src/core/Akka.Remote.TestKit/Internals/TestConductorConfigFactory.cs b/src/core/Akka.Remote.TestKit/Internals/TestConductorConfigFactory.cs index ae837e58c6d..e81120b5e25 100644 --- a/src/core/Akka.Remote.TestKit/Internals/TestConductorConfigFactory.cs +++ b/src/core/Akka.Remote.TestKit/Internals/TestConductorConfigFactory.cs @@ -36,11 +36,7 @@ public static Config Default() /// The configuration defined in the current executing assembly. internal static Config FromResource(string resourceName) { -#if CORECLR - var assembly = typeof(TestConductorConfigFactory).GetTypeInfo().Assembly; -#else var assembly = typeof(TestConductorConfigFactory).Assembly; -#endif using (var stream = assembly.GetManifestResourceStream(resourceName)) { diff --git a/src/core/Akka.Remote.TestKit/MultiNodeSpec.cs b/src/core/Akka.Remote.TestKit/MultiNodeSpec.cs index 76cae3aade8..93c590e24bc 100644 --- a/src/core/Akka.Remote.TestKit/MultiNodeSpec.cs +++ b/src/core/Akka.Remote.TestKit/MultiNodeSpec.cs @@ -403,13 +403,7 @@ protected MultiNodeSpec( _roles = roles; _deployments = deployments; -#if CORECLR - var dnsTask = Dns.GetHostAddressesAsync(ServerName); - dnsTask.Wait(); - var node = new IPEndPoint(dnsTask.Result[0], ServerPort); -#else var node = new IPEndPoint(Dns.GetHostAddresses(ServerName)[0], ServerPort); -#endif _controllerAddr = node; AttachConductor(new TestConductor(system)); diff --git a/src/core/Akka.Remote.Tests/Transport/DotNettySslSupportSpec.cs b/src/core/Akka.Remote.Tests/Transport/DotNettySslSupportSpec.cs index 91f360d5075..1c462ca9d8d 100644 --- a/src/core/Akka.Remote.Tests/Transport/DotNettySslSupportSpec.cs +++ b/src/core/Akka.Remote.Tests/Transport/DotNettySslSupportSpec.cs @@ -194,12 +194,8 @@ private void InstallCert() } finally { -#if NET452 //netstandard 1.6 doesn't have close on store store.Close(); -#else -#endif } - } @@ -220,10 +216,7 @@ private void RemoveCert() } finally { -#if NET452 //NetStandard1.6 doesn't have close on store. store.Close(); -#else -#endif } } public class Echo : ReceiveActor diff --git a/src/core/Akka.Remote/AckedDelivery.cs b/src/core/Akka.Remote/AckedDelivery.cs index 5cd647f5b79..81a3da96346 100644 --- a/src/core/Akka.Remote/AckedDelivery.cs +++ b/src/core/Akka.Remote/AckedDelivery.cs @@ -336,7 +336,6 @@ public ResendBufferCapacityReachedException(int c) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -346,7 +345,6 @@ protected ResendBufferCapacityReachedException(SerializationInfo info, Streaming : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Remote/Akka.Remote.csproj b/src/core/Akka.Remote/Akka.Remote.csproj index 3aeca588a04..2ad4f0db839 100644 --- a/src/core/Akka.Remote/Akka.Remote.csproj +++ b/src/core/Akka.Remote/Akka.Remote.csproj @@ -16,9 +16,6 @@ - - $(DefineConstants);SERIALIZATION - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Remote/Endpoint.cs b/src/core/Akka.Remote/Endpoint.cs index afbcfd80b5a..5acb5001fc8 100644 --- a/src/core/Akka.Remote/Endpoint.cs +++ b/src/core/Akka.Remote/Endpoint.cs @@ -191,7 +191,6 @@ internal class EndpointException : AkkaException /// The exception that is the cause of the current exception. public EndpointException(string message, Exception cause = null) : base(message, cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -201,7 +200,6 @@ protected EndpointException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Remote/RemoteTransport.cs b/src/core/Akka.Remote/RemoteTransport.cs index 2e863ea048c..fa832f1b8bd 100644 --- a/src/core/Akka.Remote/RemoteTransport.cs +++ b/src/core/Akka.Remote/RemoteTransport.cs @@ -132,7 +132,6 @@ public RemoteTransportException(string message, Exception cause = null) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -142,7 +141,6 @@ protected RemoteTransportException(SerializationInfo info, StreamingContext cont : base(info, context) { } -#endif } } diff --git a/src/core/Akka.Remote/Serialization/ExceptionSupport.cs b/src/core/Akka.Remote/Serialization/ExceptionSupport.cs index ef58f3e6f55..e99756c43a4 100644 --- a/src/core/Akka.Remote/Serialization/ExceptionSupport.cs +++ b/src/core/Akka.Remote/Serialization/ExceptionSupport.cs @@ -12,9 +12,7 @@ using Akka.Util; using Akka.Util.Internal; using Google.Protobuf; -#if SERIALIZATION using System.Runtime.Serialization; -#endif namespace Akka.Remote.Serialization { @@ -53,11 +51,7 @@ public byte[] SerializeException(Exception exception) internal Proto.Msg.ExceptionData ExceptionToProto(Exception exception) { -#if SERIALIZATION return ExceptionToProtoNet(exception); -#else - return ExceptionToProtoNetCore(exception); -#endif } public Exception DeserializeException(byte[] bytes) @@ -68,14 +62,9 @@ public Exception DeserializeException(byte[] bytes) internal Exception ExceptionFromProto(Proto.Msg.ExceptionData proto) { -#if SERIALIZATION return ExceptionFromProtoNet(proto); -#else - return ExceptionFromProtoNetCore(proto); -#endif } -#if SERIALIZATION private FormatterConverter DefaultFormatterConverter = new FormatterConverter(); public Proto.Msg.ExceptionData ExceptionToProtoNet(Exception exception) @@ -147,79 +136,5 @@ public Exception ExceptionFromProtoNet(Proto.Msg.ExceptionData proto) return obj; } -#else - private TypeInfo ExceptionTypeInfo = typeof(Exception).GetTypeInfo(); - private static readonly Func GetUninitializedObjectDelegate = (Func) - typeof(string) - .GetTypeInfo() - .Assembly - .GetType("System.Runtime.Serialization.FormatterServices") - ?.GetTypeInfo() - ?.GetMethod("GetUninitializedObject", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static) - ?.CreateDelegate(typeof(Func)); - - internal Proto.Msg.ExceptionData ExceptionToProtoNetCore(Exception exception) - { - var message = new Proto.Msg.ExceptionData(); - - if (exception == null) - return message; - - var exceptionType = exception.GetType(); - - message.TypeName = exceptionType.TypeQualifiedName(); - message.Message = exception.Message; - message.StackTrace = exception.StackTrace ?? ""; - message.Source = exception.Source ?? ""; - message.InnerException = ExceptionToProto(exception.InnerException); - - // serialize all public properties - foreach (var property in exceptionType.GetTypeInfo().DeclaredProperties) - { - if (DefaultProperties.Contains(property.Name)) continue; - if (property.SetMethod != null) - { - message.CustomFields.Add(property.Name, _wrappedPayloadSupport.PayloadToProto(property.GetValue(exception))); - } - } - - return message; - } - - internal Exception ExceptionFromProtoNetCore(Proto.Msg.ExceptionData proto) - { - if (string.IsNullOrEmpty(proto.TypeName)) - return null; - - Type exceptionType = Type.GetType(proto.TypeName); - - var obj = GetUninitializedObjectDelegate(exceptionType); - - if (!string.IsNullOrEmpty(proto.Message)) - ExceptionTypeInfo?.GetField("_message", All)?.SetValue(obj, proto.Message); - - if (!string.IsNullOrEmpty(proto.StackTrace)) - ExceptionTypeInfo?.GetField("_stackTraceString", All)?.SetValue(obj, proto.StackTrace); - - if (!string.IsNullOrEmpty(proto.Source)) - ExceptionTypeInfo?.GetField("_source", All)?.SetValue(obj, proto.Source); - - if (!string.IsNullOrEmpty(proto.InnerException.TypeName)) - ExceptionTypeInfo?.GetField("_innerException", All)?.SetValue(obj, ExceptionFromProto(proto.InnerException)); - - // deserialize all public properties with setters - foreach (var property in proto.CustomFields) - { - if (DefaultProperties.Contains(property.Key)) continue; - var prop = exceptionType.GetProperty(property.Key, All); - if (prop.SetMethod != null) - { - prop.SetValue(obj, _wrappedPayloadSupport.PayloadFrom(property.Value)); - } - } - - return (Exception)obj; - } -#endif } } diff --git a/src/core/Akka.Remote/Transport/AkkaPduCodec.cs b/src/core/Akka.Remote/Transport/AkkaPduCodec.cs index 51cef7d84f9..aa87407cc49 100644 --- a/src/core/Akka.Remote/Transport/AkkaPduCodec.cs +++ b/src/core/Akka.Remote/Transport/AkkaPduCodec.cs @@ -28,7 +28,6 @@ internal class PduCodecException : AkkaException /// The exception that is the cause of the current exception. public PduCodecException(string message, Exception cause = null) : base(message, cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -38,7 +37,6 @@ protected PduCodecException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /* diff --git a/src/core/Akka.Remote/Transport/AkkaProtocolTransport.cs b/src/core/Akka.Remote/Transport/AkkaProtocolTransport.cs index 7f607c8a890..72d18e3c62b 100644 --- a/src/core/Akka.Remote/Transport/AkkaProtocolTransport.cs +++ b/src/core/Akka.Remote/Transport/AkkaProtocolTransport.cs @@ -63,7 +63,6 @@ public class AkkaProtocolException : AkkaException /// The exception that is the cause of the current exception. public AkkaProtocolException(string message, Exception cause = null) : base(message, cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -73,7 +72,6 @@ protected AkkaProtocolException(SerializationInfo info, StreamingContext context : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs index 129a5e675ad..30b117bb4bf 100644 --- a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs +++ b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransport.cs @@ -104,7 +104,6 @@ public DotNettyTransportException(string message, Exception cause = null) : base { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -113,7 +112,6 @@ public DotNettyTransportException(string message, Exception cause = null) : base protected DotNettyTransportException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } internal abstract class DotNettyTransport : Transport diff --git a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransportSettings.cs b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransportSettings.cs index 8aaf23b4776..226997cbe67 100644 --- a/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransportSettings.cs +++ b/src/core/Akka.Remote/Transport/DotNetty/DotNettyTransportSettings.cs @@ -362,13 +362,8 @@ public SslSettings(string certificateThumbprint, string storeName, StoreLocation } finally { -#if NET45 //netstandard1.6 doesn't have close on store. store.Close(); -#else -#endif - } - } public SslSettings(string certificatePath, string certificatePassword, X509KeyStorageFlags flags, bool suppressValidation) diff --git a/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs b/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs index 7494a4e5aaa..4b209cc68d1 100644 --- a/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs +++ b/src/core/Akka.Remote/Transport/FailureInjectorTransportAdapter.cs @@ -48,7 +48,6 @@ public FailureInjectorException(string msg) Msg = msg; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -58,7 +57,6 @@ private FailureInjectorException(SerializationInfo info, StreamingContext contex : base(info, context) { } -#endif /// /// Retrieves the message of the simulated failure. diff --git a/src/core/Akka.Remote/Transport/Transport.cs b/src/core/Akka.Remote/Transport/Transport.cs index f64018395c2..5941dc259b2 100644 --- a/src/core/Akka.Remote/Transport/Transport.cs +++ b/src/core/Akka.Remote/Transport/Transport.cs @@ -99,7 +99,6 @@ public InvalidAssociationException(string message, Exception cause = null) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -109,7 +108,6 @@ protected InvalidAssociationException(SerializationInfo info, StreamingContext c : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj b/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj index 5e3f6ceaf13..28e49dd9de9 100644 --- a/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj +++ b/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj @@ -25,7 +25,7 @@ - $(DefineConstants);SERIALIZATION;AKKAIO + $(DefineConstants);AKKAIO diff --git a/src/core/Akka.Streams.TestKit.Tests/ScriptedTest.cs b/src/core/Akka.Streams.TestKit.Tests/ScriptedTest.cs index d61e4cc454d..69614bfadc0 100644 --- a/src/core/Akka.Streams.TestKit.Tests/ScriptedTest.cs +++ b/src/core/Akka.Streams.TestKit.Tests/ScriptedTest.cs @@ -27,10 +27,7 @@ public class ScriptException : Exception public ScriptException() { } public ScriptException(string message) : base(message) { } public ScriptException(string message, Exception inner) : base(message, inner) { } - -#if SERIALIZATION protected ScriptException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } public abstract class ScriptedTest : AkkaSpec diff --git a/src/core/Akka.Streams.TestKit/TestSubscriber.cs b/src/core/Akka.Streams.TestKit/TestSubscriber.cs index 6ef427bf873..cc5012ea817 100644 --- a/src/core/Akka.Streams.TestKit/TestSubscriber.cs +++ b/src/core/Akka.Streams.TestKit/TestSubscriber.cs @@ -34,7 +34,7 @@ public OnSubscribe(ISubscription subscription) public override string ToString() => $"TestSubscriber.OnSubscribe({Subscription})"; } - public struct OnNext : ISubscriberEvent + public struct OnNext : ISubscriberEvent, IEquatable> { public readonly T Element; @@ -44,6 +44,21 @@ public OnNext(T element) } public override string ToString() => $"TestSubscriber.OnNext({Element})"; + + public bool Equals(OnNext other) + { + return EqualityComparer.Default.Equals(Element, other.Element); + } + + public override bool Equals(object obj) + { + return obj is OnNext other && Equals(other); + } + + public override int GetHashCode() + { + return EqualityComparer.Default.GetHashCode(Element); + } } public sealed class OnComplete: ISubscriberEvent diff --git a/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj b/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj index ecc5c2148f3..27a6703cb0d 100644 --- a/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj +++ b/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj @@ -37,8 +37,8 @@ - - $(DefineConstants);SERIALIZATION;CONFIGURATION;UNSAFE_THREADING;AKKAIO + + $(DefineConstants);CONFIGURATION;UNSAFE_THREADING;AKKAIO diff --git a/src/core/Akka.Streams/ActorMaterializer.cs b/src/core/Akka.Streams/ActorMaterializer.cs index 16f1b5d026c..fe491e76ca7 100644 --- a/src/core/Akka.Streams/ActorMaterializer.cs +++ b/src/core/Akka.Streams/ActorMaterializer.cs @@ -238,7 +238,6 @@ public AbruptTerminationException(IActorRef actor) Actor = actor; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -248,7 +247,6 @@ protected AbruptTerminationException(SerializationInfo info, StreamingContext co { Actor = (IActorRef)info.GetValue("Actor", typeof(IActorRef)); } -#endif } /// @@ -263,14 +261,12 @@ public class MaterializationException : Exception /// The exception that is the cause of the current exception. public MaterializationException(string message, Exception innerException) : base(message, innerException) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected MaterializationException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/Akka.Streams.csproj b/src/core/Akka.Streams/Akka.Streams.csproj index 6182adba964..b13d74a73ec 100644 --- a/src/core/Akka.Streams/Akka.Streams.csproj +++ b/src/core/Akka.Streams/Akka.Streams.csproj @@ -65,7 +65,7 @@ - $(DefineConstants);SERIALIZATION;CLONEABLE;AKKAIO + $(DefineConstants);AKKAIO $(DefineConstants);CORECLR diff --git a/src/core/Akka.Streams/Dsl/Keep.cs b/src/core/Akka.Streams/Dsl/Keep.cs index 4df6e531de5..4bde1f85eb1 100644 --- a/src/core/Akka.Streams/Dsl/Keep.cs +++ b/src/core/Akka.Streams/Dsl/Keep.cs @@ -56,11 +56,7 @@ public static class Keep /// TBD public static NotUsed None(TLeft left, TRight right) => NotUsed.Instance; -#if !CORECLR private static readonly RuntimeMethodHandle KeepRightMethodhandle = typeof(Keep).GetMethod(nameof(Right)).MethodHandle; -#else - private static readonly MethodInfo KeepRightMethodInfo = typeof(Keep).GetMethod(nameof(Right)); -#endif /// /// TBD @@ -72,18 +68,10 @@ public static class Keep /// TBD public static bool IsRight(Func fn) { -#if !CORECLR return fn.GetMethodInfo().IsGenericMethod && fn.GetMethodInfo().GetGenericMethodDefinition().MethodHandle.Value == KeepRightMethodhandle.Value; -#else - return fn.GetMethodInfo().IsGenericMethod && fn.GetMethodInfo().GetGenericMethodDefinition().Equals(KeepRightMethodInfo); -#endif } -#if !CORECLR private static readonly RuntimeMethodHandle KeepLeftMethodhandle = typeof(Keep).GetMethod(nameof(Left)).MethodHandle; -#else - private static readonly MethodInfo KeepLeftMethodInfo = typeof(Keep).GetMethod(nameof(Left)); -#endif /// /// TBD @@ -95,11 +83,7 @@ public static bool IsRight(Func fn) /// TBD public static bool IsLeft(Func fn) { -#if !CORECLR return fn.GetMethodInfo().IsGenericMethod && fn.GetMethodInfo().GetGenericMethodDefinition().MethodHandle.Value == KeepLeftMethodhandle.Value; -#else - return fn.GetMethodInfo().IsGenericMethod && fn.GetMethodInfo().GetGenericMethodDefinition().Equals(KeepLeftMethodInfo); -#endif } } } diff --git a/src/core/Akka.Streams/Implementation/ActorPublisher.cs b/src/core/Akka.Streams/Implementation/ActorPublisher.cs index 0c5d962df92..fa35031cb06 100644 --- a/src/core/Akka.Streams/Implementation/ActorPublisher.cs +++ b/src/core/Akka.Streams/Implementation/ActorPublisher.cs @@ -114,14 +114,12 @@ public class NormalShutdownException : IllegalStateException /// The message that describes the error. public NormalShutdownException(string message) : base(message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected NormalShutdownException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/Implementation/ReactiveStreamsCompliance.cs b/src/core/Akka.Streams/Implementation/ReactiveStreamsCompliance.cs index 921c59da7e1..e6e771820a2 100644 --- a/src/core/Akka.Streams/Implementation/ReactiveStreamsCompliance.cs +++ b/src/core/Akka.Streams/Implementation/ReactiveStreamsCompliance.cs @@ -30,14 +30,12 @@ public class SignalThrewException : IllegalStateException, ISpecViolation /// The exception that is the cause of the current exception. public SignalThrewException(string message, Exception cause) : base(message, cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected SignalThrewException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs b/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs index ef71280b786..8f2b07eff45 100644 --- a/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs +++ b/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs @@ -29,7 +29,6 @@ private NothingToReadException() { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -39,7 +38,6 @@ protected NothingToReadException(SerializationInfo info, StreamingContext contex : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/Implementation/StreamLayout.cs b/src/core/Akka.Streams/Implementation/StreamLayout.cs index a2687d43ba0..fb38a3944b8 100644 --- a/src/core/Akka.Streams/Implementation/StreamLayout.cs +++ b/src/core/Akka.Streams/Implementation/StreamLayout.cs @@ -2142,7 +2142,6 @@ public MaterializationPanicException(Exception innerException) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -2152,7 +2151,6 @@ protected MaterializationPanicException(SerializationInfo info, StreamingContext : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/Implementation/StreamSubscriptionTimeout.cs b/src/core/Akka.Streams/Implementation/StreamSubscriptionTimeout.cs index 3c17c7b1171..2a829ad5ce8 100644 --- a/src/core/Akka.Streams/Implementation/StreamSubscriptionTimeout.cs +++ b/src/core/Akka.Streams/Implementation/StreamSubscriptionTimeout.cs @@ -36,7 +36,6 @@ public SubscriptionTimeoutException(string message, Exception innerException) : { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -45,7 +44,6 @@ public SubscriptionTimeoutException(string message, Exception innerException) : protected SubscriptionTimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/OverflowStrategy.cs b/src/core/Akka.Streams/OverflowStrategy.cs index 0d254098b18..78f53336c73 100644 --- a/src/core/Akka.Streams/OverflowStrategy.cs +++ b/src/core/Akka.Streams/OverflowStrategy.cs @@ -110,7 +110,6 @@ public BufferOverflowException(string message, Exception innerException) : base( { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -119,6 +118,5 @@ public BufferOverflowException(string message, Exception innerException) : base( protected BufferOverflowException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka.Streams/Shape.cs b/src/core/Akka.Streams/Shape.cs index 0b523aeda7d..f64f7bca53d 100644 --- a/src/core/Akka.Streams/Shape.cs +++ b/src/core/Akka.Streams/Shape.cs @@ -173,10 +173,7 @@ public Outlet(string name) : base(name) { } /// matters from the outside are the connections that can be made with it, /// otherwise it is just a black box. /// - public abstract class Shape -#if CLONEABLE - : ICloneable -#endif + public abstract class Shape : ICloneable { /// /// Gets list of all input ports. diff --git a/src/core/Akka.Streams/Stage/GraphStage.cs b/src/core/Akka.Streams/Stage/GraphStage.cs index 08613227e97..4bdfaa15bf3 100644 --- a/src/core/Akka.Streams/Stage/GraphStage.cs +++ b/src/core/Akka.Streams/Stage/GraphStage.cs @@ -2177,14 +2177,12 @@ public class StageActorRefNotInitializedException : Exception public static readonly StageActorRefNotInitializedException Instance = new StageActorRefNotInitializedException(); private StageActorRefNotInitializedException() : base("You must first call GetStageActorRef(StageActorRef.Receive), to initialize the actor's behavior") { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// /// The that holds the serialized object data about the exception being thrown. /// The that contains contextual information about the source or destination. protected StageActorRefNotInitializedException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// diff --git a/src/core/Akka.Streams/StreamLimitReachedException.cs b/src/core/Akka.Streams/StreamLimitReachedException.cs index 89af4c95899..8b0bed05fda 100644 --- a/src/core/Akka.Streams/StreamLimitReachedException.cs +++ b/src/core/Akka.Streams/StreamLimitReachedException.cs @@ -23,7 +23,6 @@ public StreamLimitReachedException(long max) : base($"Limit of {max} reached") { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -32,6 +31,5 @@ public StreamLimitReachedException(long max) : base($"Limit of {max} reached") protected StreamLimitReachedException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka.Streams/StreamTcpException.cs b/src/core/Akka.Streams/StreamTcpException.cs index c34dfa8078b..618b28ad9e9 100644 --- a/src/core/Akka.Streams/StreamTcpException.cs +++ b/src/core/Akka.Streams/StreamTcpException.cs @@ -32,7 +32,6 @@ public StreamTcpException(string message, Exception innerException) : base(messa { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -41,7 +40,6 @@ public StreamTcpException(string message, Exception innerException) : base(messa protected StreamTcpException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// @@ -58,7 +56,6 @@ private BindFailedException() : base("bind failed") { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -67,7 +64,6 @@ private BindFailedException() : base("bind failed") protected BindFailedException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// @@ -92,7 +88,6 @@ public ConnectionException(string message, Exception innerException) : base(mess { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -101,6 +96,5 @@ public ConnectionException(string message, Exception innerException) : base(mess protected ConnectionException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj b/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj index 967ddd44975..be9116a2ce1 100644 --- a/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj +++ b/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj @@ -19,9 +19,6 @@ - - $(DefineConstants);SERIALIZATION - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Tests.Shared.Internals/AkkaSpec.cs b/src/core/Akka.Tests.Shared.Internals/AkkaSpec.cs index ecfad51e492..690272cc718 100644 --- a/src/core/Akka.Tests.Shared.Internals/AkkaSpec.cs +++ b/src/core/Akka.Tests.Shared.Internals/AkkaSpec.cs @@ -90,10 +90,6 @@ protected virtual void AfterTermination() { } private static string GetCallerName() { -#if CORECLR - // TODO: CORECLR FIX IT - var name = "AkkaSpec"; -#else var systemNumber = Interlocked.Increment(ref _systemNumber); var stackTrace = new StackTrace(0); var name = stackTrace.GetFrames(). @@ -102,7 +98,7 @@ private static string GetCallerName() SkipWhile(m => m.DeclaringType.Name == "AkkaSpec"). Select(m => _nameReplaceRegex.Replace(m.DeclaringType.Name + "-" + systemNumber, "-")). FirstOrDefault() ?? "test"; -#endif + return name; } diff --git a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs index 7d4863acc2b..546aa6941bd 100644 --- a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs +++ b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs @@ -46,6 +46,12 @@ public class ThreadReporterActor : ReceiveActor { public ThreadReporterActor() { + // Improve reliability of ForkJoinExecutorShouldShutdownUponAllActorsTerminating + // test which intermittently can fail because all messages are actually serviced + // by a single thread from the pool. Happens under load, presumably when the processor + // finds it more efficient to keep thread locality of the execution. + Thread.Sleep(1); + Receive(_ => Sender.Tell(Thread.CurrentThread)); } } @@ -76,6 +82,7 @@ public async Task ForkJoinExecutorShouldShutdownUponActorSystemTermination() threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); + threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); await Sys.Terminate(); AwaitAssert(() => @@ -90,12 +97,12 @@ public void ForkJoinExecutorShouldShutdownUponAllActorsTerminating() Dictionary threads = null; Watch(actor); - var msgCount = 100; - for (var i = 0; i < msgCount; i++) + for (var i = 0; i < 100; i++) actor.Tell(GetThread.Instance); - threads = ReceiveN(msgCount).Cast().GroupBy(x => x.ManagedThreadId) + threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); + threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); Sys.Stop(actor); ExpectTerminated(actor); diff --git a/src/core/Akka.Tests/Akka.Tests.csproj b/src/core/Akka.Tests/Akka.Tests.csproj index 2ab15c9a4fc..0c486220c0e 100644 --- a/src/core/Akka.Tests/Akka.Tests.csproj +++ b/src/core/Akka.Tests/Akka.Tests.csproj @@ -30,7 +30,7 @@ - $(DefineConstants);SERIALIZATION;CONFIGURATION;UNSAFE_THREADING + $(DefineConstants);CONFIGURATION;UNSAFE_THREADING diff --git a/src/core/Akka.Tests/Pattern/CircuitBreakerSpec.cs b/src/core/Akka.Tests/Pattern/CircuitBreakerSpec.cs index 91ccb562a37..aa48d9af6a9 100644 --- a/src/core/Akka.Tests/Pattern/CircuitBreakerSpec.cs +++ b/src/core/Akka.Tests/Pattern/CircuitBreakerSpec.cs @@ -342,12 +342,10 @@ public TestException( string message, Exception innerException ) { } -#if SERIALIZATION protected TestException( SerializationInfo info, StreamingContext context ) : base( info, context ) { } -#endif } } diff --git a/src/core/Akka/Actor/Address.cs b/src/core/Akka/Actor/Address.cs index e0fd83dd484..601a1f93728 100644 --- a/src/core/Akka/Actor/Address.cs +++ b/src/core/Akka/Actor/Address.cs @@ -23,10 +23,7 @@ namespace Akka.Actor /// for example a remote transport would want to associate additional /// information with an address, then this must be done externally. /// - public sealed class Address : IEquatable
, IComparable
, IComparable, ISurrogated -#if CLONEABLE - , ICloneable -#endif + public sealed class Address : IEquatable
, IComparable
, IComparable, ISurrogated, ICloneable { #region comparer diff --git a/src/core/Akka/Actor/CoordinatedShutdown.cs b/src/core/Akka/Actor/CoordinatedShutdown.cs index bb0d7fd8760..b15127af306 100644 --- a/src/core/Akka/Actor/CoordinatedShutdown.cs +++ b/src/core/Akka/Actor/CoordinatedShutdown.cs @@ -671,16 +671,12 @@ internal static void InitClrHook(ActorSystem system, Config conf, CoordinatedShu var runByClrShutdownHook = conf.GetBoolean("run-by-clr-shutdown-hook"); if (runByClrShutdownHook) { -#if APPDOMAIN // run all hooks during termination sequence AppDomain.CurrentDomain.ProcessExit += (sender, args) => { // have to block, because if this method exits the process exits. coord.RunClrHooks().Wait(coord.TotalTimeout); }; -#else - // TODO: what to do for NetCore? -#endif coord.AddClrShutdownHook(() => { diff --git a/src/core/Akka/Actor/Exceptions.cs b/src/core/Akka/Actor/Exceptions.cs index 09bfefe8d32..9fb1c24044a 100644 --- a/src/core/Akka/Actor/Exceptions.cs +++ b/src/core/Akka/Actor/Exceptions.cs @@ -32,7 +32,6 @@ protected AkkaException(string message, Exception cause = null) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -42,7 +41,6 @@ protected AkkaException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif /// /// The exception that is the cause of the current exception. @@ -74,7 +72,6 @@ public InvalidActorNameException(string message, Exception innerException) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -84,7 +81,6 @@ protected InvalidActorNameException(SerializationInfo info, StreamingContext con : base(info, context) { } -#endif } /// @@ -101,7 +97,6 @@ public AskTimeoutException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -111,7 +106,6 @@ protected AskTimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// @@ -173,7 +167,6 @@ public ActorInitializationException(IActorRef actor, string message, Exception c Actor = actor; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -191,7 +184,6 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont info.AddValue("Actor", Actor); base.GetObjectData(info, context); } -#endif /// /// Retrieves the actor whose initialization logic failed. @@ -243,7 +235,6 @@ public LoggerInitializationException(string message, Exception cause = null) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -253,7 +244,6 @@ protected LoggerInitializationException(SerializationInfo info, StreamingContext : base(info, context) { } -#endif } /// @@ -275,7 +265,6 @@ public ActorKilledException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -285,7 +274,6 @@ protected ActorKilledException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// @@ -303,7 +291,6 @@ public IllegalActorStateException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -313,7 +300,6 @@ protected IllegalActorStateException(SerializationInfo info, StreamingContext co : base(info, context) { } -#endif } /// @@ -330,7 +316,6 @@ public IllegalActorNameException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -340,7 +325,6 @@ protected IllegalActorNameException(SerializationInfo info, StreamingContext con : base(info, context) { } -#endif } /// @@ -361,7 +345,6 @@ public DeathPactException(IActorRef deadActor) _deadActor = deadActor; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -371,7 +354,6 @@ protected DeathPactException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif /// /// Retrieves the actor that has been terminated. @@ -412,7 +394,6 @@ public PreRestartException(IActorRef actor, Exception restartException, Exceptio this.optionalMessage = optionalMessage; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -422,7 +403,6 @@ protected PreRestartException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } /// @@ -445,7 +425,6 @@ public PostRestartException(IActorRef actor, Exception cause, Exception original _originalCause = originalCause; } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -455,7 +434,6 @@ protected PostRestartException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif /// /// Retrieves the exception which caused the restart in the first place. @@ -476,7 +454,6 @@ public ActorNotFoundException() { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -486,7 +463,6 @@ protected ActorNotFoundException(SerializationInfo info, StreamingContext contex : base(info, context) { } -#endif /// /// that takes a descriptive and optional . @@ -522,7 +498,6 @@ public InvalidMessageException(string message) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -532,7 +507,6 @@ protected InvalidMessageException(SerializationInfo info, StreamingContext conte : base(info, context) { } -#endif } } diff --git a/src/core/Akka/Actor/Props.cs b/src/core/Akka/Actor/Props.cs index 0451c1ab628..ae4cdc36099 100644 --- a/src/core/Akka/Actor/Props.cs +++ b/src/core/Akka/Actor/Props.cs @@ -770,13 +770,8 @@ private DynamicProps(Props copy, Func invoker) /// The newly created protected override Props Copy() { - Props initialCopy = base.Copy(); -#if CLONEABLE + var initialCopy = base.Copy(); var invokerCopy = (Func)invoker.Clone(); -#else - // TODO: CORECLR FIX IT - var invokerCopy = (Func)invoker; -#endif return new DynamicProps(initialCopy, invokerCopy); } diff --git a/src/core/Akka/Actor/Stash/StashOverflowException.cs b/src/core/Akka/Actor/Stash/StashOverflowException.cs index ac92b5a6a5d..beaa6fca609 100644 --- a/src/core/Akka/Actor/Stash/StashOverflowException.cs +++ b/src/core/Akka/Actor/Stash/StashOverflowException.cs @@ -22,7 +22,6 @@ public class StashOverflowException : AkkaException /// The exception that is the cause of the current exception. public StashOverflowException(string message, Exception cause = null) : base(message, cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -32,6 +31,5 @@ protected StashOverflowException(SerializationInfo info, StreamingContext contex : base(info, context) { } -#endif } } diff --git a/src/core/Akka/Akka.csproj b/src/core/Akka/Akka.csproj index 087b4501289..da9f256e4d1 100644 --- a/src/core/Akka/Akka.csproj +++ b/src/core/Akka/Akka.csproj @@ -35,7 +35,7 @@ - $(DefineConstants);SERIALIZATION;CONFIGURATION;UNSAFE_THREADING;CLONEABLE;APPDOMAIN + $(DefineConstants);CONFIGURATION;UNSAFE_THREADING diff --git a/src/core/Akka/Configuration/ConfigurationException.cs b/src/core/Akka/Configuration/ConfigurationException.cs index 3c2478cdaec..84f2f04a1b4 100644 --- a/src/core/Akka/Configuration/ConfigurationException.cs +++ b/src/core/Akka/Configuration/ConfigurationException.cs @@ -33,7 +33,6 @@ public ConfigurationException(string message, Exception exception): base(message { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -43,7 +42,6 @@ protected ConfigurationException(SerializationInfo info, StreamingContext contex : base(info, context) { } -#endif } } diff --git a/src/core/Akka/Dispatch/AbstractDispatcher.cs b/src/core/Akka/Dispatch/AbstractDispatcher.cs index 19a78365eac..6a285708aa5 100644 --- a/src/core/Akka/Dispatch/AbstractDispatcher.cs +++ b/src/core/Akka/Dispatch/AbstractDispatcher.cs @@ -213,9 +213,7 @@ private static DedicatedThreadPoolSettings ConfigureSettings(Config config) /// internal sealed class ThreadPoolExecutorServiceFactory : ExecutorServiceConfigurator { -#if APPDOMAIN private static readonly bool IsFullTrusted = AppDomain.CurrentDomain.IsFullyTrusted; -#endif /// /// TBD @@ -224,7 +222,7 @@ internal sealed class ThreadPoolExecutorServiceFactory : ExecutorServiceConfigur /// TBD public override ExecutorService Produce(string id) { -#if APPDOMAIN +#if UNSAFE_THREADING if (IsFullTrusted) return new FullThreadPoolExecutorServiceImpl(id); #endif diff --git a/src/core/Akka/Pattern/IllegalStateException.cs b/src/core/Akka/Pattern/IllegalStateException.cs index ad879694868..204e613a619 100644 --- a/src/core/Akka/Pattern/IllegalStateException.cs +++ b/src/core/Akka/Pattern/IllegalStateException.cs @@ -33,7 +33,6 @@ public IllegalStateException(string message, Exception innerEx) : base(message, { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -43,6 +42,5 @@ protected IllegalStateException(SerializationInfo info, StreamingContext context : base(info, context) { } -#endif } } diff --git a/src/core/Akka/Pattern/OpenCircuitException.cs b/src/core/Akka/Pattern/OpenCircuitException.cs index ad2eb6d299d..2caf46ecae9 100644 --- a/src/core/Akka/Pattern/OpenCircuitException.cs +++ b/src/core/Akka/Pattern/OpenCircuitException.cs @@ -40,7 +40,6 @@ public OpenCircuitException(string message, Exception cause) { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -50,6 +49,5 @@ protected OpenCircuitException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka/Routing/TailChopping.cs b/src/core/Akka/Routing/TailChopping.cs index 435c9dde420..cdd3ec34b8f 100644 --- a/src/core/Akka/Routing/TailChopping.cs +++ b/src/core/Akka/Routing/TailChopping.cs @@ -122,7 +122,14 @@ public override void Send(object message, IActorRef sender) try { - completion.TrySetResult(await (_routees[currentIndex].Ask(message, _within)).ConfigureAwait(false)); + completion.TrySetResult( + await (_routees[currentIndex].Ask(message, _within)).ConfigureAwait(false)); + } + catch (AskTimeoutException) + { + completion.TrySetResult( + new Status.Failure( + new AskTimeoutException($"Ask timed out on {sender} after {_within}"))); } catch (TaskCanceledException) { From 98680a2e2c98294078e31479b34981fcd10af4e2 Mon Sep 17 00:00:00 2001 From: matthew Date: Thu, 16 May 2019 18:36:16 +1000 Subject: [PATCH 02/13] Correct version numbers for Clean target #3668 --- build.fsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.fsx b/build.fsx index 14c3be2c270..c4bc1dc656f 100644 --- a/build.fsx +++ b/build.fsx @@ -25,8 +25,8 @@ let outputPerfTests = __SOURCE_DIRECTORY__ @@ "PerfResults" let outputBinaries = output @@ "binaries" let outputNuGet = output @@ "nuget" let outputMultiNode = outputTests @@ "multinode" -let outputBinariesNet45 = outputBinaries @@ "net45" -let outputBinariesNetStandard = outputBinaries @@ "netstandard1.6" +let outputBinariesNet45 = outputBinaries @@ "net452" +let outputBinariesNetStandard = outputBinaries @@ "netstandard2.0" let buildNumber = environVarOrDefault "BUILD_NUMBER" "0" let hasTeamCity = (not (buildNumber = "0")) // check if we have the TeamCity environment variable for build # set @@ -313,7 +313,7 @@ open Fake.TemplateHelper Target "PublishMntr" (fun _ -> let executableProjects = !! "./src/**/Akka.MultiNodeTestRunner.csproj" - // Windows .NET 4.5.2 + // Restore executableProjects |> Seq.iter (fun project -> DotNetCli.Restore (fun p -> @@ -322,7 +322,7 @@ Target "PublishMntr" (fun _ -> AdditionalArgs = ["-r win7-x64"; sprintf "/p:VersionSuffix=%s" versionSuffix] }) ) - // Windows .NET 4.5.2 + // Windows .NET 4.6.1 executableProjects |> Seq.iter (fun project -> DotNetCli.Publish (fun p -> From 23a583e2cef3b7b1dec3ddb9a449b530fb52cc4a Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 2 Apr 2021 00:30:08 +0700 Subject: [PATCH 03/13] Post-merge cleanup --- .../Akka.Serialization.Hyperion.csproj | 2 +- src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs | 1 + .../Implementation/ResizableMultiReaderRingBuffer.cs | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj b/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj index 9ade912588c..8fb0de29efb 100644 --- a/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj +++ b/src/contrib/serializers/Akka.Serialization.Hyperion/Akka.Serialization.Hyperion.csproj @@ -14,7 +14,7 @@ - + diff --git a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs index 6a0b7c210a7..24a5054ef73 100644 --- a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs +++ b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Runtime.Serialization; using Akka.Actor; using Akka.Configuration; using Akka.Persistence.TCK.Serialization; diff --git a/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs b/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs index 3c90e901bbf..b0ab1226c76 100644 --- a/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs +++ b/src/core/Akka.Streams/Implementation/ResizableMultiReaderRingBuffer.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; using Akka.Annotations; using Akka.Streams.Util; From 47a853057032193f443198cd7be2e43f68ef28cc Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 16 Apr 2021 21:12:04 +0700 Subject: [PATCH 04/13] csproj and code cleanup --- ...ka.Cluster.Sharding.Tests.MultiNode.csproj | 8 ------- .../Akka.Cluster.Sharding.Tests.csproj | 8 ------- .../Akka.Cluster.Sharding.csproj | 10 --------- .../Akka.Cluster.Tools.Tests.MultiNode.csproj | 4 ---- .../Akka.Cluster.Tools.Tests.csproj | 8 ------- .../Akka.Cluster.Tools.csproj | 4 ---- ...kka.DistributedData.Tests.MultiNode.csproj | 4 ---- .../Akka.DistributedData.Tests.csproj | 4 ---- .../Akka.DistributedData.csproj | 4 ---- .../Akka.DI.Core/Akka.DI.Core.csproj | 6 +----- .../Akka.DI.TestKit/Akka.DI.TestKit.csproj | 4 ---- .../Akka.Persistence.Query.Sql.csproj | 9 -------- .../Akka.Persistence.Sql.Common.csproj | 10 +-------- .../Journal/BatchingSqlJournal.cs | 2 -- .../Journal/SqlJournal.cs | 2 -- .../Snapshot/SqlSnapshotStore.cs | 2 -- .../Akka.Persistence.Sql.TestKit.csproj | 4 ---- .../Akka.Persistence.Sqlite.Tests.csproj | 4 ---- .../Akka.Cluster.TestKit.csproj | 4 ---- .../Akka.Cluster.Tests.MultiNode.csproj | 4 ---- .../Akka.Cluster.Tests.csproj | 8 ------- src/core/Akka.Cluster/Akka.Cluster.csproj | 4 ---- .../Akka.Coordination.Tests.csproj | 8 ------- .../Akka.Coordination.csproj | 4 ---- src/core/Akka.Coordination/LeaseException.cs | 3 +-- .../LeaseTimeoutException.cs | 3 +-- src/core/Akka.Discovery/Akka.Discovery.csproj | 4 ---- ...ka.MultiNodeTestRunner.Shared.Tests.csproj | 4 ---- .../Akka.MultiNodeTestRunner.Shared.csproj | 4 ---- .../CompilerErrorCollection.cs | 2 -- .../Extensions/DateTimeExtension.cs | 2 -- .../Extensions/TypeExtension.cs | 2 -- .../Akka.Persistence.Query.Tests.csproj | 8 ------- .../Akka.Persistence.TCK.Tests.csproj | 8 ------- .../Akka.Persistence.TCK.csproj | 8 ------- .../Akka.Persistence.TestKit.Tests.csproj | 4 ---- .../Akka.Persistence.Tests.csproj | 8 ------- .../Akka.Persistence/Akka.Persistence.csproj | 3 --- .../Akka.Remote.TestKit.Tests.csproj | 8 ------- .../Akka.Remote.TestKit.csproj | 5 ----- .../Akka.Remote.Tests.MultiNode.csproj | 4 ---- src/core/Akka.Remote/Akka.Remote.csproj | 3 --- .../Akka.Streams.TestKit.Tests.csproj | 8 ------- .../Akka.Streams.TestKit.csproj | 4 ---- .../Akka.Streams.Tests.csproj | 10 --------- .../Dsl/StageActorRefSpec.cs | 4 ++-- .../Implementation/StreamLayoutSpec.cs | 2 -- src/core/Akka.Streams/Akka.Streams.csproj | 6 ------ .../WatchedActorTerminatedException.cs | 2 -- .../Akka.TestKit.Tests.csproj | 7 ------- src/core/Akka.TestKit/Akka.TestKit.csproj | 4 ---- .../Akka.Tests.Shared.Internals.csproj | 4 ---- src/core/Akka.Tests/Akka.Tests.csproj | 13 +----------- src/core/Akka.Tests/IO/TcpIntegrationSpec.cs | 10 ++------- src/core/Akka/Akka.csproj | 9 +------- .../Configuration/ConfigurationFactory.cs | 4 ---- .../Hocon/AkkaConfigurationSection.cs | 2 -- .../Hocon/CDataConfigurationElement.cs | 2 -- .../Hocon/HoconConfigurationElement.cs | 2 -- .../Util/MatchHandler/CachedMatchCompiler.cs | 21 ------------------- .../MatchHandler/ILambdaExpressionCompiler.cs | 9 -------- .../Akka/Util/MatchHandler/IMatchCompiler.cs | 14 ------------- .../MatchHandler/LambdaExpressionCompiler.cs | 13 ------------ .../Akka/Util/MatchHandler/MatchBuilder.cs | 15 ------------- src/core/Akka/Util/RuntimeDetector.cs | 7 +------ 65 files changed, 11 insertions(+), 373 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/Akka.Cluster.Sharding.Tests.MultiNode.csproj b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/Akka.Cluster.Sharding.Tests.MultiNode.csproj index 5e3524af359..377aa9d05d8 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/Akka.Cluster.Sharding.Tests.MultiNode.csproj +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests.MultiNode/Akka.Cluster.Sharding.Tests.MultiNode.csproj @@ -25,14 +25,6 @@ - - $(DefineConstants); - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/Akka.Cluster.Sharding.Tests.csproj b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/Akka.Cluster.Sharding.Tests.csproj index de4079d687c..e3331ead973 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding.Tests/Akka.Cluster.Sharding.Tests.csproj +++ b/src/contrib/cluster/Akka.Cluster.Sharding.Tests/Akka.Cluster.Sharding.Tests.csproj @@ -27,14 +27,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj b/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj index a5fd351780e..8234137e52c 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj +++ b/src/contrib/cluster/Akka.Cluster.Sharding/Akka.Cluster.Sharding.csproj @@ -18,16 +18,6 @@ - - - - - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Akka.Cluster.Tools.Tests.MultiNode.csproj b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Akka.Cluster.Tools.Tests.MultiNode.csproj index 6317a468a79..466bb53fc8a 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Akka.Cluster.Tools.Tests.MultiNode.csproj +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests.MultiNode/Akka.Cluster.Tools.Tests.MultiNode.csproj @@ -19,10 +19,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests/Akka.Cluster.Tools.Tests.csproj b/src/contrib/cluster/Akka.Cluster.Tools.Tests/Akka.Cluster.Tools.Tests.csproj index 664c232ced6..5ed0131226e 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests/Akka.Cluster.Tools.Tests.csproj +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests/Akka.Cluster.Tools.Tests.csproj @@ -19,14 +19,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj b/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj index 4b03bb18282..dc65eda72f2 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj +++ b/src/contrib/cluster/Akka.Cluster.Tools/Akka.Cluster.Tools.csproj @@ -15,10 +15,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/Akka.DistributedData.Tests.MultiNode.csproj b/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/Akka.DistributedData.Tests.MultiNode.csproj index 5f7445c71a1..205ab0ae536 100644 --- a/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/Akka.DistributedData.Tests.MultiNode.csproj +++ b/src/contrib/cluster/Akka.DistributedData.Tests.MultiNode/Akka.DistributedData.Tests.MultiNode.csproj @@ -24,10 +24,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.DistributedData.Tests/Akka.DistributedData.Tests.csproj b/src/contrib/cluster/Akka.DistributedData.Tests/Akka.DistributedData.Tests.csproj index f1e12967f2b..f54d7a07fa8 100644 --- a/src/contrib/cluster/Akka.DistributedData.Tests/Akka.DistributedData.Tests.csproj +++ b/src/contrib/cluster/Akka.DistributedData.Tests/Akka.DistributedData.Tests.csproj @@ -20,10 +20,6 @@ - - $(DefineConstants);SERIALIZABLE - - $(DefineConstants);RELEASE diff --git a/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj b/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj index b78b724f0a9..8927f87542e 100644 --- a/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj +++ b/src/contrib/cluster/Akka.DistributedData/Akka.DistributedData.csproj @@ -18,10 +18,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj b/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj index c4e9bda2f64..c4c0ea24639 100644 --- a/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj +++ b/src/contrib/dependencyinjection/Akka.DI.Core/Akka.DI.Core.csproj @@ -13,15 +13,11 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE - + diff --git a/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj b/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj index 5a05e968c59..17377f73ee8 100644 --- a/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj +++ b/src/contrib/dependencyinjection/Akka.DI.TestKit/Akka.DI.TestKit.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj b/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj index 0947bbb0bbf..a80b880462a 100644 --- a/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj +++ b/src/contrib/persistence/Akka.Persistence.Query.Sql/Akka.Persistence.Query.Sql.csproj @@ -16,15 +16,6 @@ - - - - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj b/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj index b4fd3db42e8..6c74759db1c 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Akka.Persistence.Sql.Common.csproj @@ -17,18 +17,10 @@ - + - - $(DefineConstants);CONFIGURATION - - - - $(DefineConstants);CORECLR;CONFIGURATION - - $(DefineConstants);RELEASE diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs index 19f24f30044..a77efec189d 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs @@ -256,14 +256,12 @@ protected BatchingSqlJournalSetup(Config config, QueryConfiguration namingConven throw ConfigurationException.NullOrEmptyConfig(); var connectionString = config.GetString("connection-string", null); -#if CONFIGURATION if (string.IsNullOrWhiteSpace(connectionString)) { connectionString = System.Configuration.ConfigurationManager .ConnectionStrings[config.GetString("connection-string-name", "DefaultConnection")]? .ConnectionString; } -#endif if (string.IsNullOrWhiteSpace(connectionString)) throw new ConfigurationException("No connection string for Sql Event Journal was specified"); diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs index b043c1c1cbf..8d74a49c1b0 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/SqlJournal.cs @@ -506,12 +506,10 @@ protected virtual string GetConnectionString() { var connectionString = _settings.ConnectionString; -#if CONFIGURATION if (string.IsNullOrEmpty(connectionString)) { connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[_settings.ConnectionStringName].ConnectionString; } -#endif return connectionString; } diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs index ad92d5c665b..f63d246e7b3 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Snapshot/SqlSnapshotStore.cs @@ -149,12 +149,10 @@ protected virtual string GetConnectionString() { var connectionString = _settings.ConnectionString; -#if CONFIGURATION if (string.IsNullOrEmpty(connectionString)) { connectionString = System.Configuration.ConfigurationManager.ConnectionStrings[_settings.ConnectionStringName].ConnectionString; } -#endif return connectionString; } diff --git a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj index 65bd043c117..b4c479e7925 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj +++ b/src/contrib/persistence/Akka.Persistence.Sql.TestKit/Akka.Persistence.Sql.TestKit.csproj @@ -16,10 +16,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Akka.Persistence.Sqlite.Tests.csproj b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Akka.Persistence.Sqlite.Tests.csproj index 69486b773af..a396432f1ef 100644 --- a/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Akka.Persistence.Sqlite.Tests.csproj +++ b/src/contrib/persistence/Akka.Persistence.Sqlite.Tests/Akka.Persistence.Sqlite.Tests.csproj @@ -27,10 +27,6 @@ - - $(DefineConstants);SERIALIZABLE - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj b/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj index 79e457c9e33..5325de65dda 100644 --- a/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj +++ b/src/core/Akka.Cluster.TestKit/Akka.Cluster.TestKit.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Cluster.Tests.MultiNode/Akka.Cluster.Tests.MultiNode.csproj b/src/core/Akka.Cluster.Tests.MultiNode/Akka.Cluster.Tests.MultiNode.csproj index ffc6127b3c5..ac5e689df8f 100644 --- a/src/core/Akka.Cluster.Tests.MultiNode/Akka.Cluster.Tests.MultiNode.csproj +++ b/src/core/Akka.Cluster.Tests.MultiNode/Akka.Cluster.Tests.MultiNode.csproj @@ -22,10 +22,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Cluster.Tests/Akka.Cluster.Tests.csproj b/src/core/Akka.Cluster.Tests/Akka.Cluster.Tests.csproj index 18a9e2568db..cb9c0a38226 100644 --- a/src/core/Akka.Cluster.Tests/Akka.Cluster.Tests.csproj +++ b/src/core/Akka.Cluster.Tests/Akka.Cluster.Tests.csproj @@ -21,14 +21,6 @@ - - $(DefineConstants);SERIALIZABLE; - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Cluster/Akka.Cluster.csproj b/src/core/Akka.Cluster/Akka.Cluster.csproj index d0f36dd09af..de08aa79f62 100644 --- a/src/core/Akka.Cluster/Akka.Cluster.csproj +++ b/src/core/Akka.Cluster/Akka.Cluster.csproj @@ -15,10 +15,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Coordination.Tests/Akka.Coordination.Tests.csproj b/src/core/Akka.Coordination.Tests/Akka.Coordination.Tests.csproj index 376da941fd6..21a0b770c56 100644 --- a/src/core/Akka.Coordination.Tests/Akka.Coordination.Tests.csproj +++ b/src/core/Akka.Coordination.Tests/Akka.Coordination.Tests.csproj @@ -20,14 +20,6 @@ - - $(DefineConstants);SERIALIZABLE; - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Coordination/Akka.Coordination.csproj b/src/core/Akka.Coordination/Akka.Coordination.csproj index c6bef8940a3..60fc6c4a9d2 100644 --- a/src/core/Akka.Coordination/Akka.Coordination.csproj +++ b/src/core/Akka.Coordination/Akka.Coordination.csproj @@ -9,10 +9,6 @@ true - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Coordination/LeaseException.cs b/src/core/Akka.Coordination/LeaseException.cs index 153c8fc25ef..29dec0b4c2a 100644 --- a/src/core/Akka.Coordination/LeaseException.cs +++ b/src/core/Akka.Coordination/LeaseException.cs @@ -6,6 +6,7 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; namespace Akka.Coordination { @@ -32,12 +33,10 @@ public LeaseException(string message, Exception innerEx) { } -#if SERIALIZATION protected LeaseException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka.Coordination/LeaseTimeoutException.cs b/src/core/Akka.Coordination/LeaseTimeoutException.cs index b86f7f0aee7..911ae3e6c8e 100644 --- a/src/core/Akka.Coordination/LeaseTimeoutException.cs +++ b/src/core/Akka.Coordination/LeaseTimeoutException.cs @@ -6,6 +6,7 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; namespace Akka.Coordination { @@ -32,12 +33,10 @@ public LeaseTimeoutException(string message, Exception innerEx) { } -#if SERIALIZATION protected LeaseTimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { } -#endif } } diff --git a/src/core/Akka.Discovery/Akka.Discovery.csproj b/src/core/Akka.Discovery/Akka.Discovery.csproj index 0538dc05d49..b1506fc1ef7 100644 --- a/src/core/Akka.Discovery/Akka.Discovery.csproj +++ b/src/core/Akka.Discovery/Akka.Discovery.csproj @@ -23,10 +23,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/Akka.MultiNodeTestRunner.Shared.Tests.csproj b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/Akka.MultiNodeTestRunner.Shared.Tests.csproj index 2202d5e4c4f..52925f37da8 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared.Tests/Akka.MultiNodeTestRunner.Shared.Tests.csproj +++ b/src/core/Akka.MultiNodeTestRunner.Shared.Tests/Akka.MultiNodeTestRunner.Shared.Tests.csproj @@ -27,10 +27,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Akka.MultiNodeTestRunner.Shared.csproj b/src/core/Akka.MultiNodeTestRunner.Shared/Akka.MultiNodeTestRunner.Shared.csproj index bff83b1d9b2..ea0d22b714a 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Akka.MultiNodeTestRunner.Shared.csproj +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Akka.MultiNodeTestRunner.Shared.csproj @@ -33,10 +33,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/CompilerErrorCollection.cs b/src/core/Akka.MultiNodeTestRunner.Shared/CompilerErrorCollection.cs index 86a5f50ef22..9e6889d5467 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/CompilerErrorCollection.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/CompilerErrorCollection.cs @@ -9,7 +9,6 @@ using System.Collections.Generic; using System.Reflection; -#if CORECLR namespace System.CodeDom.Compiler { public class CompilerErrorCollection : List @@ -22,4 +21,3 @@ public class CompilerError public bool IsWarning { get; set; } } } -#endif diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/DateTimeExtension.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/DateTimeExtension.cs index a149c39075a..981d7ada914 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/DateTimeExtension.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/DateTimeExtension.cs @@ -12,7 +12,6 @@ using System.Text; using System.Threading.Tasks; -#if CORECLR namespace Akka.MultiNodeTestRunner.Shared.Extensions { internal static class DateTimeExtension @@ -23,4 +22,3 @@ public static string ToShortTimeString(this DateTime dateTime) } } } -#endif diff --git a/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/TypeExtension.cs b/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/TypeExtension.cs index ca6be97f546..6b0b371ff30 100644 --- a/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/TypeExtension.cs +++ b/src/core/Akka.MultiNodeTestRunner.Shared/Extensions/TypeExtension.cs @@ -12,7 +12,6 @@ using System.Text; using System.Threading.Tasks; -#if CORECLR namespace Akka.MultiNodeTestRunner.Shared.Extensions { internal static class TypeExtension @@ -23,4 +22,3 @@ public static MethodInfo GetMethod(this Type type, string method, params Type[] } } } -#endif diff --git a/src/core/Akka.Persistence.Query.Tests/Akka.Persistence.Query.Tests.csproj b/src/core/Akka.Persistence.Query.Tests/Akka.Persistence.Query.Tests.csproj index 18660d72b06..087a19a6c01 100644 --- a/src/core/Akka.Persistence.Query.Tests/Akka.Persistence.Query.Tests.csproj +++ b/src/core/Akka.Persistence.Query.Tests/Akka.Persistence.Query.Tests.csproj @@ -23,14 +23,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence.TCK.Tests/Akka.Persistence.TCK.Tests.csproj b/src/core/Akka.Persistence.TCK.Tests/Akka.Persistence.TCK.Tests.csproj index 2906e799e2c..6ccfccb8b8a 100644 --- a/src/core/Akka.Persistence.TCK.Tests/Akka.Persistence.TCK.Tests.csproj +++ b/src/core/Akka.Persistence.TCK.Tests/Akka.Persistence.TCK.Tests.csproj @@ -18,14 +18,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj b/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj index a8660db1231..20630676aae 100644 --- a/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj +++ b/src/core/Akka.Persistence.TCK/Akka.Persistence.TCK.csproj @@ -20,14 +20,6 @@ - - $(DefineConstants);SERIALIZATION - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence.TestKit.Tests/Akka.Persistence.TestKit.Tests.csproj b/src/core/Akka.Persistence.TestKit.Tests/Akka.Persistence.TestKit.Tests.csproj index f85e0a212d3..904e599ab7e 100644 --- a/src/core/Akka.Persistence.TestKit.Tests/Akka.Persistence.TestKit.Tests.csproj +++ b/src/core/Akka.Persistence.TestKit.Tests/Akka.Persistence.TestKit.Tests.csproj @@ -23,10 +23,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence.Tests/Akka.Persistence.Tests.csproj b/src/core/Akka.Persistence.Tests/Akka.Persistence.Tests.csproj index 6d8d97a6971..c13d632210c 100644 --- a/src/core/Akka.Persistence.Tests/Akka.Persistence.Tests.csproj +++ b/src/core/Akka.Persistence.Tests/Akka.Persistence.Tests.csproj @@ -25,14 +25,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Persistence/Akka.Persistence.csproj b/src/core/Akka.Persistence/Akka.Persistence.csproj index 2ca58072544..24509b35af6 100644 --- a/src/core/Akka.Persistence/Akka.Persistence.csproj +++ b/src/core/Akka.Persistence/Akka.Persistence.csproj @@ -14,9 +14,6 @@ - - $(DefineConstants);CORECLR - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Remote.TestKit.Tests/Akka.Remote.TestKit.Tests.csproj b/src/core/Akka.Remote.TestKit.Tests/Akka.Remote.TestKit.Tests.csproj index 432597cd86a..85ff907b309 100644 --- a/src/core/Akka.Remote.TestKit.Tests/Akka.Remote.TestKit.Tests.csproj +++ b/src/core/Akka.Remote.TestKit.Tests/Akka.Remote.TestKit.Tests.csproj @@ -23,14 +23,6 @@ - - $(DefineConstants);SERIALIZABLE - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj b/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj index 30d3186f72a..d19e3b81d57 100644 --- a/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj +++ b/src/core/Akka.Remote.TestKit/Akka.Remote.TestKit.csproj @@ -23,11 +23,6 @@ - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Remote.Tests.MultiNode/Akka.Remote.Tests.MultiNode.csproj b/src/core/Akka.Remote.Tests.MultiNode/Akka.Remote.Tests.MultiNode.csproj index b5c14a11e32..aa0d86570ea 100644 --- a/src/core/Akka.Remote.Tests.MultiNode/Akka.Remote.Tests.MultiNode.csproj +++ b/src/core/Akka.Remote.Tests.MultiNode/Akka.Remote.Tests.MultiNode.csproj @@ -27,10 +27,6 @@ $(DefineConstants); - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Remote/Akka.Remote.csproj b/src/core/Akka.Remote/Akka.Remote.csproj index 24f27dca6f8..5b1f41f9715 100644 --- a/src/core/Akka.Remote/Akka.Remote.csproj +++ b/src/core/Akka.Remote/Akka.Remote.csproj @@ -15,9 +15,6 @@ - - $(DefineConstants);CORECLR - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj b/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj index f1b4ce9f7be..97bb9020904 100644 --- a/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj +++ b/src/core/Akka.Streams.TestKit.Tests/Akka.Streams.TestKit.Tests.csproj @@ -25,14 +25,6 @@ - - $(DefineConstants);AKKAIO - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj b/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj index b423898c67f..a550bdd7f82 100644 --- a/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj +++ b/src/core/Akka.Streams.TestKit/Akka.Streams.TestKit.csproj @@ -14,10 +14,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj b/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj index 3e1f603c392..b28f8f02ec2 100644 --- a/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj +++ b/src/core/Akka.Streams.Tests/Akka.Streams.Tests.csproj @@ -35,16 +35,6 @@ - - - $(DefineConstants);CONFIGURATION;UNSAFE_THREADING;AKKAIO - $(DefineConstants);SERIALIZATION;CONFIGURATION;AKKAIO - - - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs b/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs index 04e67b704b1..ee949e80ce5 100644 --- a/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs +++ b/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs @@ -178,7 +178,7 @@ public async Task A_Graph_stage_ActorRef_must_ignore_and_log_warnings_for_Poison warn.Message.ToString() .Should() .MatchRegex( - " message sent to StageActor\\(akka\\://AkkaSpec/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); + " message sent to StageActor\\(akka\\://StageActorRefSpec-1/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); stageRef.Tell(Kill.Instance); warn = ExpectMsg(TimeSpan.FromSeconds(1)); @@ -186,7 +186,7 @@ public async Task A_Graph_stage_ActorRef_must_ignore_and_log_warnings_for_Poison warn.Message.ToString() .Should() .MatchRegex( - " message sent to StageActor\\(akka\\://AkkaSpec/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); + " message sent to StageActor\\(akka\\://StageActorRefSpec-1/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); source.SetResult(2); diff --git a/src/core/Akka.Streams.Tests/Implementation/StreamLayoutSpec.cs b/src/core/Akka.Streams.Tests/Implementation/StreamLayoutSpec.cs index 7f3f7c5aeec..d8bef953f4b 100644 --- a/src/core/Akka.Streams.Tests/Implementation/StreamLayoutSpec.cs +++ b/src/core/Akka.Streams.Tests/Implementation/StreamLayoutSpec.cs @@ -240,7 +240,6 @@ public void StreamLayout_should_be_able_to_materialize_linear_layouts() CheckMaterialized(runnable); } -#if !CORECLR [Fact(Skip = "We can't catch a StackOverflowException")] public void StreamLayout_should_fail_fusing_when_value_computation_is_too_complex() { @@ -250,7 +249,6 @@ public void StreamLayout_should_fail_fusing_when_value_computation_is_too_comple (flow, i) => flow.MapMaterializedValue(x => x + i)); g.Invoking(flow => Streams.Fusing.Aggressive(flow)).Should().Throw(); } -#endif [Fact] public void StreamLayout_should_not_fail_materialization_when_building_a_large_graph_with_simple_computation_when_starting_from_a_Source() diff --git a/src/core/Akka.Streams/Akka.Streams.csproj b/src/core/Akka.Streams/Akka.Streams.csproj index f901bcc17c1..e3205c5a705 100644 --- a/src/core/Akka.Streams/Akka.Streams.csproj +++ b/src/core/Akka.Streams/Akka.Streams.csproj @@ -65,12 +65,6 @@ - - $(DefineConstants);AKKAIO - - - $(DefineConstants);CORECLR - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Streams/WatchedActorTerminatedException.cs b/src/core/Akka.Streams/WatchedActorTerminatedException.cs index 1af2a78c1b5..d053febeb72 100644 --- a/src/core/Akka.Streams/WatchedActorTerminatedException.cs +++ b/src/core/Akka.Streams/WatchedActorTerminatedException.cs @@ -24,7 +24,6 @@ public WatchedActorTerminatedException(string stageName, IActorRef actorRef) : base($"Actor watched by [{stageName}] has terminated! Was: {actorRef}") { } -#if SERIALIZATION /// /// Initializes a new instance of the class. /// @@ -34,6 +33,5 @@ protected WatchedActorTerminatedException(SerializationInfo info, StreamingConte : base(info, context) { } -#endif } } diff --git a/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj b/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj index 997adc2bf0a..220b17aef65 100644 --- a/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj +++ b/src/core/Akka.TestKit.Tests/Akka.TestKit.Tests.csproj @@ -20,13 +20,6 @@ - - - $(DefineConstants);SERIALIZATION - - - $(DefineConstants);CORECLR - $(DefineConstants);RELEASE diff --git a/src/core/Akka.TestKit/Akka.TestKit.csproj b/src/core/Akka.TestKit/Akka.TestKit.csproj index ff46c35b560..4c97416d237 100644 --- a/src/core/Akka.TestKit/Akka.TestKit.csproj +++ b/src/core/Akka.TestKit/Akka.TestKit.csproj @@ -26,10 +26,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Tests.Shared.Internals/Akka.Tests.Shared.Internals.csproj b/src/core/Akka.Tests.Shared.Internals/Akka.Tests.Shared.Internals.csproj index 9e398362397..8bf338ed6f2 100644 --- a/src/core/Akka.Tests.Shared.Internals/Akka.Tests.Shared.Internals.csproj +++ b/src/core/Akka.Tests.Shared.Internals/Akka.Tests.Shared.Internals.csproj @@ -16,10 +16,6 @@ - - $(DefineConstants);CORECLR - - $(DefineConstants);RELEASE diff --git a/src/core/Akka.Tests/Akka.Tests.csproj b/src/core/Akka.Tests/Akka.Tests.csproj index 624e0aec586..1c9d08c164f 100644 --- a/src/core/Akka.Tests/Akka.Tests.csproj +++ b/src/core/Akka.Tests/Akka.Tests.csproj @@ -21,22 +21,11 @@ - - - - - - - + - - $(DefineConstants);CONFIGURATION;UNSAFE_THREADING - $(DefineConstants);SERIALIZATION;CONFIGURATION - - $(DefineConstants);CORECLR diff --git a/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs b/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs index 67937d68e57..71dc1af5fed 100644 --- a/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs +++ b/src/core/Akka.Tests/IO/TcpIntegrationSpec.cs @@ -21,9 +21,7 @@ using Xunit; using Xunit.Abstractions; using FluentAssertions; -#if CORECLR using System.Runtime.InteropServices; -#endif namespace Akka.Tests.IO { @@ -172,14 +170,10 @@ public void The_TCP_transport_implementation_should_properly_handle_connection_a public void The_TCP_transport_implementation_should_properly_support_connecting_to_DNS_endpoints(AddressFamily family) { // Aaronontheweb, 9/2/2017 - POSIX-based OSES are still having trouble with IPV6 DNS resolution -#if CORECLR - if(!System.Runtime.InteropServices.RuntimeInformation + if(!RuntimeInformation .IsOSPlatform(OSPlatform.Windows) && family == AddressFamily.InterNetworkV6) - return; -#else - if (RuntimeDetector.IsMono && family == AddressFamily.InterNetworkV6) // same as above return; -#endif + var serverHandler = CreateTestProbe(); var bindCommander = CreateTestProbe(); bindCommander.Send(Sys.Tcp(), new Tcp.Bind(serverHandler.Ref, new IPEndPoint(family == AddressFamily.InterNetwork ? IPAddress.Loopback diff --git a/src/core/Akka/Akka.csproj b/src/core/Akka/Akka.csproj index 0f15878e83a..b9575eb34a4 100644 --- a/src/core/Akka/Akka.csproj +++ b/src/core/Akka/Akka.csproj @@ -17,6 +17,7 @@ + @@ -37,14 +38,6 @@ - - $(DefineConstants);CONFIGURATION;UNSAFE_THREADING - - - - $(DefineConstants);CORECLR;CONFIGURATION; - - $(DefineConstants);RELEASE diff --git a/src/core/Akka/Configuration/ConfigurationFactory.cs b/src/core/Akka/Configuration/ConfigurationFactory.cs index 220963ec7aa..ac2b9aec733 100644 --- a/src/core/Akka/Configuration/ConfigurationFactory.cs +++ b/src/core/Akka/Configuration/ConfigurationFactory.cs @@ -61,12 +61,8 @@ public static Config ParseString(string hocon) /// The configuration defined in the configuration file. public static Config Load() { -#if CONFIGURATION var section = (AkkaConfigurationSection)System.Configuration.ConfigurationManager.GetSection("akka") ?? new AkkaConfigurationSection(); return section.AkkaConfig; -#else - return ConfigurationFactory.Empty; -#endif } /// diff --git a/src/core/Akka/Configuration/Hocon/AkkaConfigurationSection.cs b/src/core/Akka/Configuration/Hocon/AkkaConfigurationSection.cs index 687d8bb2b31..2b9f2dba518 100644 --- a/src/core/Akka/Configuration/Hocon/AkkaConfigurationSection.cs +++ b/src/core/Akka/Configuration/Hocon/AkkaConfigurationSection.cs @@ -5,7 +5,6 @@ // //----------------------------------------------------------------------- -#if CONFIGURATION using System.Configuration; namespace Akka.Configuration.Hocon @@ -67,4 +66,3 @@ public HoconConfigurationElement Hocon } } } -#endif diff --git a/src/core/Akka/Configuration/Hocon/CDataConfigurationElement.cs b/src/core/Akka/Configuration/Hocon/CDataConfigurationElement.cs index deb49e041ef..ea9a839d498 100644 --- a/src/core/Akka/Configuration/Hocon/CDataConfigurationElement.cs +++ b/src/core/Akka/Configuration/Hocon/CDataConfigurationElement.cs @@ -5,7 +5,6 @@ // //----------------------------------------------------------------------- -#if CONFIGURATION using System.Configuration; using System.Xml; @@ -64,4 +63,3 @@ protected override void DeserializeElement(XmlReader reader, bool serializeColle } } } -#endif diff --git a/src/core/Akka/Configuration/Hocon/HoconConfigurationElement.cs b/src/core/Akka/Configuration/Hocon/HoconConfigurationElement.cs index c8ab219be96..177863060a4 100644 --- a/src/core/Akka/Configuration/Hocon/HoconConfigurationElement.cs +++ b/src/core/Akka/Configuration/Hocon/HoconConfigurationElement.cs @@ -5,7 +5,6 @@ // //----------------------------------------------------------------------- -#if CONFIGURATION using System.Configuration; namespace Akka.Configuration.Hocon @@ -42,4 +41,3 @@ public string Content } } } -#endif diff --git a/src/core/Akka/Util/MatchHandler/CachedMatchCompiler.cs b/src/core/Akka/Util/MatchHandler/CachedMatchCompiler.cs index 45daa4b7594..48b3e5c72df 100644 --- a/src/core/Akka/Util/MatchHandler/CachedMatchCompiler.cs +++ b/src/core/Akka/Util/MatchHandler/CachedMatchCompiler.cs @@ -71,27 +71,6 @@ private Delegate CompileToDelegate(IReadOnlyList handlers, IReadOnl delegateArguments = result.Arguments; return compiledLambda; } - -#if !CORECLR - /// - /// TBD - /// - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - public void CompileToMethod(IReadOnlyList handlers, IReadOnlyList capturedArguments, MatchBuilderSignature signature, TypeBuilder typeBuilder, string methodName, MethodAttributes methodAttributes = MethodAttributes.Public | MethodAttributes.Static) - { - var result = _expressionBuilder.BuildLambdaExpression(handlers); - var lambdaExpression = result.LambdaExpression; - var parameterTypes = lambdaExpression.Parameters.Select(p => p.Type).ToArray(); - var method = typeBuilder.DefineMethod(methodName, methodAttributes, typeof(bool), parameterTypes); - _expressionCompiler.CompileToMethod(lambdaExpression, method); - } -#endif } } diff --git a/src/core/Akka/Util/MatchHandler/ILambdaExpressionCompiler.cs b/src/core/Akka/Util/MatchHandler/ILambdaExpressionCompiler.cs index 1a874995707..e7ee61bbfc1 100644 --- a/src/core/Akka/Util/MatchHandler/ILambdaExpressionCompiler.cs +++ b/src/core/Akka/Util/MatchHandler/ILambdaExpressionCompiler.cs @@ -22,15 +22,6 @@ internal interface ILambdaExpressionCompiler /// The expression to compile /// A delegate containing the compiled version of the lambda. Delegate Compile(LambdaExpression expression); - -#if !CORECLR - /// - /// Compiles the lambda into a method definition. - /// - /// The expression to compile - /// A which will be used to hold the lambda's IL. - void CompileToMethod(LambdaExpression expression, MethodBuilder method); -#endif } } diff --git a/src/core/Akka/Util/MatchHandler/IMatchCompiler.cs b/src/core/Akka/Util/MatchHandler/IMatchCompiler.cs index 4d597cf4b13..b06e99381f3 100644 --- a/src/core/Akka/Util/MatchHandler/IMatchCompiler.cs +++ b/src/core/Akka/Util/MatchHandler/IMatchCompiler.cs @@ -25,20 +25,6 @@ internal interface IMatchCompiler /// TBD /// TBD PartialAction Compile(IReadOnlyList handlers, IReadOnlyList capturedArguments, MatchBuilderSignature signature); - -#if !CORECLR - /// - /// TBD - /// - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - /// TBD - void CompileToMethod(IReadOnlyList handlers, IReadOnlyList capturedArguments, MatchBuilderSignature signature, TypeBuilder typeBuilder, string methodName, MethodAttributes methodAttributes = MethodAttributes.Public | MethodAttributes.Static); -#endif } } diff --git a/src/core/Akka/Util/MatchHandler/LambdaExpressionCompiler.cs b/src/core/Akka/Util/MatchHandler/LambdaExpressionCompiler.cs index 205bb2a8f92..c1357d07a8f 100644 --- a/src/core/Akka/Util/MatchHandler/LambdaExpressionCompiler.cs +++ b/src/core/Akka/Util/MatchHandler/LambdaExpressionCompiler.cs @@ -25,19 +25,6 @@ public Delegate Compile(LambdaExpression expression) { return expression.Compile(); } - -#if !CORECLR - /// - /// TBD - /// - /// TBD - /// - /// TBD - public void CompileToMethod(LambdaExpression expression, MethodBuilder method) - { - expression.CompileToMethod(method); - } -#endif } } diff --git a/src/core/Akka/Util/MatchHandler/MatchBuilder.cs b/src/core/Akka/Util/MatchHandler/MatchBuilder.cs index 40ed83b6a2d..62b415b79ec 100644 --- a/src/core/Akka/Util/MatchHandler/MatchBuilder.cs +++ b/src/core/Akka/Util/MatchHandler/MatchBuilder.cs @@ -171,21 +171,6 @@ public PartialAction Build() return partialAction; } -#if !CORECLR - /// - /// TBD - /// - /// TBD - /// TBD - /// TBD - /// TBD - public void BuildToMethod(TypeBuilder typeBuilder, string methodName, MethodAttributes attributes = MethodAttributes.Public | MethodAttributes.Static) - { - _compiler.CompileToMethod(_typeHandlers, _arguments, new MatchBuilderSignature(_signature), typeBuilder, methodName, methodAttributes: attributes); - _state = State.Built; - } -#endif - private static void EnsureCanHandleType(Type handlesType) { if(!_itemType.IsAssignableFrom(handlesType)) diff --git a/src/core/Akka/Util/RuntimeDetector.cs b/src/core/Akka/Util/RuntimeDetector.cs index 7953d416f70..11190800623 100644 --- a/src/core/Akka/Util/RuntimeDetector.cs +++ b/src/core/Akka/Util/RuntimeDetector.cs @@ -37,12 +37,7 @@ public static class RuntimeDetector /// true if the current runtime is Windows private static bool _IsWindows() { -#if CORECLR - return System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows); -#else - return System.Environment.OSVersion.Platform != PlatformID.MacOSX && - System.Environment.OSVersion.Platform != PlatformID.Unix; -#endif + return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); } } } From 71e1b68a5d10babd05836e90825b0eda1d97d6aa Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Fri, 16 Apr 2021 23:06:49 +0700 Subject: [PATCH 05/13] Fix Akka.Persistence.TCK outdated journal spec, original assumption was wrong. --- .../Journal/JournalSpec.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs index 24a5054ef73..a9f15110ccf 100644 --- a/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs +++ b/src/core/Akka.Persistence.TCK/Journal/JournalSpec.cs @@ -13,6 +13,7 @@ using Akka.Actor; using Akka.Configuration; using Akka.Persistence.TCK.Serialization; +using Akka.Serialization; using Akka.TestKit; using Xunit; using Xunit.Abstractions; @@ -330,6 +331,35 @@ public void Journal_optionally_may_reject_non_serializable_events() { if (!SupportsRejectingNonSerializableObjects) return; + // Test that JSON actually fail + var serializer = Sys.Serialization.FindSerializerForType(typeof(NotSerializableEvent)); + if (!(serializer is NewtonSoftJsonSerializer)) + { + Output.WriteLine("[SKIP] This test only works with NewtonSoftJsonSerializer."); + return; + } + + var serializerFailed = false; + try + { + var serialized = serializer.ToBinary(new NotSerializableEvent(true)); + var deserialized = serializer.FromBinary(serialized); + if (!(deserialized is NotSerializableEvent)) + throw new Exception(); + } + catch (Exception) + { + serializerFailed = true; + } + + if (!serializerFailed) + { + Output.WriteLine("[SKIP] This test assumes that the serializer will fail, but it doesn't."); + return; + } + // End test + + // Start of actual test var msgs = Enumerable.Range(6, 3).Select(i => { var evt = i == 7 ? (object) new NotSerializableEvent(false) : "b-" + i; From 72d682364da1249499fe3e21c719da6842dc5cd7 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 17 Apr 2021 00:04:26 +0700 Subject: [PATCH 06/13] Avoid hardwiring names, spec name isn't hardwired anymore. --- .../Singleton/ClusterSingletonLeaseSpec.cs | 2 +- src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Tools.Tests/Singleton/ClusterSingletonLeaseSpec.cs b/src/contrib/cluster/Akka.Cluster.Tools.Tests/Singleton/ClusterSingletonLeaseSpec.cs index 06750f8ae88..cd9ca2522a2 100644 --- a/src/contrib/cluster/Akka.Cluster.Tools.Tests/Singleton/ClusterSingletonLeaseSpec.cs +++ b/src/contrib/cluster/Akka.Cluster.Tools.Tests/Singleton/ClusterSingletonLeaseSpec.cs @@ -117,7 +117,7 @@ public ClusterSingletonLeaseSpec() : base(ConfigurationFactory.ParseString(@" private ClusterSingletonManagerSettings NextSettings() => ClusterSingletonManagerSettings.Create(Sys).WithSingletonName(NextName()); - private string LeaseNameFor(ClusterSingletonManagerSettings settings) => $"AkkaSpec-singleton-akka://AkkaSpec/user/{settings.SingletonName}"; + private string LeaseNameFor(ClusterSingletonManagerSettings settings) => $"{Sys.Name}-singleton-akka://{Sys.Name}/user/{settings.SingletonName}"; [Fact] public void ClusterSingleton_with_lease_should_not_start_until_lease_is_available() diff --git a/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs b/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs index ee949e80ce5..2cd4f9b68dc 100644 --- a/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs +++ b/src/core/Akka.Streams.Tests/Dsl/StageActorRefSpec.cs @@ -178,7 +178,7 @@ public async Task A_Graph_stage_ActorRef_must_ignore_and_log_warnings_for_Poison warn.Message.ToString() .Should() .MatchRegex( - " message sent to StageActor\\(akka\\://StageActorRefSpec-1/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); + $" message sent to StageActor\\(akka\\://{Sys.Name}/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); stageRef.Tell(Kill.Instance); warn = ExpectMsg(TimeSpan.FromSeconds(1)); @@ -186,7 +186,7 @@ public async Task A_Graph_stage_ActorRef_must_ignore_and_log_warnings_for_Poison warn.Message.ToString() .Should() .MatchRegex( - " message sent to StageActor\\(akka\\://StageActorRefSpec-1/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); + $" message sent to StageActor\\(akka\\://{Sys.Name}/user/StreamSupervisor-[0-9]+/\\$\\$[a-z]+\\) will be ignored, since it is not a real Actor. Use a custom message type to communicate with it instead."); source.SetResult(2); From 074089477397e8246f0345f858c9012610ecbdbe Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 17 Apr 2021 03:11:07 +0700 Subject: [PATCH 07/13] Add serialization support to exceptions (at least for those in the Akka and Akka.Remote package) --- .../Replicator.Messages.cs | 8 +++ .../Journal/BatchingSqlJournal.cs | 11 ++++ src/core/Akka.Cluster/Cluster.cs | 11 ++++ src/core/Akka.Remote/AckedDelivery.cs | 11 ++++ src/core/Akka.Remote/Endpoint.cs | 30 +++++++++ src/core/Akka.Streams/ActorMaterializer.cs | 7 ++ src/core/Akka.Streams/Dsl/Framing.cs | 8 +++ src/core/Akka.Streams/Dsl/Graph.cs | 8 +++ src/core/Akka.Streams/Dsl/One2OneBidiFlow.cs | 16 +++++ src/core/Akka.Streams/Dsl/Tcp.cs | 8 +++ src/core/Akka.Streams/StageException.cs | 11 ++++ src/core/Akka.Streams/StreamRefs.cs | 52 +++++++++++++++ src/core/Akka/Actor/Exceptions.cs | 66 +++++++++++++------ .../Actor/Scheduler/SchedulerException.cs | 12 ++++ src/core/Akka/Dispatch/ExecutorService.cs | 8 +++ src/core/Akka/IO/Buffers/DirectBufferPool.cs | 10 +++ src/core/Akka/Pattern/OpenCircuitException.cs | 9 +++ .../Akka/Pattern/UserCalledFailException.cs | 8 +++ 18 files changed, 275 insertions(+), 19 deletions(-) diff --git a/src/contrib/cluster/Akka.DistributedData/Replicator.Messages.cs b/src/contrib/cluster/Akka.DistributedData/Replicator.Messages.cs index 4109982b925..e9800b7315c 100644 --- a/src/contrib/cluster/Akka.DistributedData/Replicator.Messages.cs +++ b/src/contrib/cluster/Akka.DistributedData/Replicator.Messages.cs @@ -997,6 +997,7 @@ public override bool Equals(object obj) /// /// TBD /// + [Serializable] public class DataDeletedException : Exception { /// @@ -1006,6 +1007,13 @@ public class DataDeletedException : Exception public DataDeletedException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected DataDeletedException(SerializationInfo info, StreamingContext context) : base(info, context) { } } public interface IReplicatorMessage { } diff --git a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs index a77efec189d..14e8b56b51c 100644 --- a/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs +++ b/src/contrib/persistence/Akka.Persistence.Sql.Common/Journal/BatchingSqlJournal.cs @@ -13,6 +13,7 @@ using System.Diagnostics; using System.Linq; using System.Runtime.CompilerServices; +using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; using Akka.Actor; @@ -1432,5 +1433,15 @@ public JournalBufferOverflowException() : base( + " change it.") { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected JournalBufferOverflowException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/core/Akka.Cluster/Cluster.cs b/src/core/Akka.Cluster/Cluster.cs index 5bef4d02955..0a02910ee6a 100644 --- a/src/core/Akka.Cluster/Cluster.cs +++ b/src/core/Akka.Cluster/Cluster.cs @@ -10,6 +10,7 @@ using System.Collections.Immutable; using System.Linq; using System.Reflection; +using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; using Akka.Actor; @@ -699,6 +700,16 @@ public class ClusterJoinFailedException : AkkaException public ClusterJoinFailedException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected ClusterJoinFailedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/core/Akka.Remote/AckedDelivery.cs b/src/core/Akka.Remote/AckedDelivery.cs index b44b21567c8..e9ad344d36e 100644 --- a/src/core/Akka.Remote/AckedDelivery.cs +++ b/src/core/Akka.Remote/AckedDelivery.cs @@ -363,6 +363,17 @@ internal class ResendUnfulfillableException : AkkaException public ResendUnfulfillableException() : base("Unable to fulfill resend request since negatively acknowledged payload is no longer in buffer. " + "The resend states between two systems are compromised and cannot be recovered") { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected ResendUnfulfillableException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } #endregion diff --git a/src/core/Akka.Remote/Endpoint.cs b/src/core/Akka.Remote/Endpoint.cs index 9d16287f26c..308b2cd3378 100644 --- a/src/core/Akka.Remote/Endpoint.cs +++ b/src/core/Akka.Remote/Endpoint.cs @@ -323,6 +323,16 @@ public EndpointDisassociatedException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected EndpointDisassociatedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } /// @@ -345,6 +355,16 @@ public EndpointAssociationException(string message) /// The message that describes the error. /// The exception that is the cause of the current exception. public EndpointAssociationException(string message, Exception innerException) : base(message, innerException) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected EndpointAssociationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } /// @@ -360,6 +380,16 @@ public OversizedPayloadException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected OversizedPayloadException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } #endregion diff --git a/src/core/Akka.Streams/ActorMaterializer.cs b/src/core/Akka.Streams/ActorMaterializer.cs index d187c815bf8..7392e70d11e 100644 --- a/src/core/Akka.Streams/ActorMaterializer.cs +++ b/src/core/Akka.Streams/ActorMaterializer.cs @@ -285,6 +285,13 @@ public AbruptStageTerminationException(GraphStageLogic logic) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected AbruptStageTerminationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } diff --git a/src/core/Akka.Streams/Dsl/Framing.cs b/src/core/Akka.Streams/Dsl/Framing.cs index db48898e4ff..d64d20c8f73 100644 --- a/src/core/Akka.Streams/Dsl/Framing.cs +++ b/src/core/Akka.Streams/Dsl/Framing.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Runtime.Serialization; using Akka.IO; using Akka.Streams.Implementation.Fusing; using Akka.Streams.Implementation.Stages; @@ -122,6 +123,13 @@ public class FramingException : Exception public FramingException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected FramingException(SerializationInfo info, StreamingContext context) : base(info, context) { } } private static readonly Func, int, int> BigEndianDecoder = (enumerator, length) => diff --git a/src/core/Akka.Streams/Dsl/Graph.cs b/src/core/Akka.Streams/Dsl/Graph.cs index aa9bd798d67..cba7566f66a 100644 --- a/src/core/Akka.Streams/Dsl/Graph.cs +++ b/src/core/Akka.Streams/Dsl/Graph.cs @@ -9,6 +9,7 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; +using System.Runtime.Serialization; using Akka.Streams.Implementation; using Akka.Streams.Implementation.Fusing; using Akka.Streams.Implementation.Stages; @@ -1211,6 +1212,13 @@ public PartitionOutOfBoundsException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected PartitionOutOfBoundsException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// diff --git a/src/core/Akka.Streams/Dsl/One2OneBidiFlow.cs b/src/core/Akka.Streams/Dsl/One2OneBidiFlow.cs index 416d9da8cef..1a4b17b16a0 100644 --- a/src/core/Akka.Streams/Dsl/One2OneBidiFlow.cs +++ b/src/core/Akka.Streams/Dsl/One2OneBidiFlow.cs @@ -6,6 +6,8 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; +using Akka.Pattern; using Akka.Streams.Stage; namespace Akka.Streams.Dsl @@ -41,6 +43,13 @@ public UnexpectedOutputException(object element) : base(element.ToString()) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected UnexpectedOutputException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// @@ -48,7 +57,14 @@ public UnexpectedOutputException(object element) : base(element.ToString()) /// public class OutputTruncationException : Exception { + public OutputTruncationException() { } + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected OutputTruncationException(SerializationInfo info, StreamingContext context) : base(info, context) { } } /// diff --git a/src/core/Akka.Streams/Dsl/Tcp.cs b/src/core/Akka.Streams/Dsl/Tcp.cs index e62f13c26df..fb47f267297 100644 --- a/src/core/Akka.Streams/Dsl/Tcp.cs +++ b/src/core/Akka.Streams/Dsl/Tcp.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Immutable; using System.Net; +using System.Runtime.Serialization; using System.Threading.Tasks; using Akka.Actor; using Akka.Annotations; @@ -303,6 +304,13 @@ public TcpIdleTimeoutException(string message, TimeSpan duration) : base(message Duration = duration; } + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected TcpIdleTimeoutException(SerializationInfo info, StreamingContext context) : base(info, context) { } + public TimeSpan Duration { get; } } } diff --git a/src/core/Akka.Streams/StageException.cs b/src/core/Akka.Streams/StageException.cs index 5ecbb6265d3..71abcde20ea 100644 --- a/src/core/Akka.Streams/StageException.cs +++ b/src/core/Akka.Streams/StageException.cs @@ -6,6 +6,7 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; namespace Akka.Streams { @@ -22,5 +23,15 @@ public NoSuchElementException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected NoSuchElementException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/core/Akka.Streams/StreamRefs.cs b/src/core/Akka.Streams/StreamRefs.cs index 8c91644d5eb..2d5247bc38b 100644 --- a/src/core/Akka.Streams/StreamRefs.cs +++ b/src/core/Akka.Streams/StreamRefs.cs @@ -6,12 +6,14 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; using Akka.Actor; using Akka.Pattern; using Akka.Streams.Dsl; using Akka.Streams.Implementation; using Akka.Util; +#pragma warning disable 628 namespace Akka.Streams { /// @@ -58,6 +60,16 @@ public TargetRefNotInitializedYetException() : base( "This should not happen due to proper flow-control, please open a ticket on the issue tracker: https://github.com/akkadotnet/akka.net") { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected TargetRefNotInitializedYetException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } public sealed class StreamRefSubscriptionTimeoutException : IllegalStateException @@ -65,6 +77,16 @@ public sealed class StreamRefSubscriptionTimeoutException : IllegalStateExceptio public StreamRefSubscriptionTimeoutException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected StreamRefSubscriptionTimeoutException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } public sealed class RemoteStreamRefActorTerminatedException : Exception @@ -75,6 +97,16 @@ public sealed class RemoteStreamRefActorTerminatedException : Exception public RemoteStreamRefActorTerminatedException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected RemoteStreamRefActorTerminatedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } public sealed class InvalidSequenceNumberException : IllegalStateException @@ -88,6 +120,16 @@ public InvalidSequenceNumberException(long expectedSeqNr, long gotSeqNr, string ExpectedSeqNr = expectedSeqNr; GotSeqNr = gotSeqNr; } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected InvalidSequenceNumberException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } /// @@ -112,5 +154,15 @@ public InvalidPartnerActorException(IActorRef expectedRef, IActorRef gotRef, str "Multi-cast such as broadcast etc can be implemented by sharing multiple new stream references. ") { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected InvalidPartnerActorException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/core/Akka/Actor/Exceptions.cs b/src/core/Akka/Actor/Exceptions.cs index 4b5643a16e7..be2080319f1 100644 --- a/src/core/Akka/Actor/Exceptions.cs +++ b/src/core/Akka/Actor/Exceptions.cs @@ -121,6 +121,16 @@ public class ActorInterruptedException : AkkaException /// TBD /// TBD public ActorInterruptedException(string message = null, Exception cause = null) : base(message, cause) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected ActorInterruptedException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } /// @@ -333,8 +343,6 @@ protected IllegalActorNameException(SerializationInfo info, StreamingContext con /// public class DeathPactException : AkkaException { - private readonly IActorRef _deadActor; - /// /// Initializes a new instance of the class. /// @@ -342,7 +350,7 @@ public class DeathPactException : AkkaException public DeathPactException(IActorRef deadActor) : base("Monitored actor [" + deadActor + "] terminated") { - _deadActor = deadActor; + DeadActor = deadActor; } /// @@ -353,15 +361,20 @@ public DeathPactException(IActorRef deadActor) protected DeathPactException(SerializationInfo info, StreamingContext context) : base(info, context) { + DeadActor = (IActorRef)info.GetValue("DeadActor", typeof(IActorRef)); + } + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + if (info == null) throw new ArgumentNullException(nameof(info)); + info.AddValue("DeadActor", DeadActor); + base.GetObjectData(info, context); } /// /// Retrieves the actor that has been terminated. /// - public IActorRef DeadActor - { - get { return _deadActor; } - } + public IActorRef DeadActor { get; } } /// @@ -372,12 +385,10 @@ public IActorRef DeadActor /// hence it is only visible as log entry on the event stream. /// /// - public class PreRestartException : AkkaException + public class PreRestartException : ActorInitializationException { - private IActorRef Actor; - private Exception e; //TODO: what is this? - private Exception exception; - private object optionalMessage; + public Exception RestartException { get; } //TODO: what is this? + public object OptionalMessage { get; } /// /// Initializes a new instance of the class. @@ -387,11 +398,11 @@ public class PreRestartException : AkkaException /// The exception which caused the restart in the first place. /// The message which was optionally passed into . public PreRestartException(IActorRef actor, Exception restartException, Exception cause, object optionalMessage) + :base(actor,"Exception pre restart (" + (restartException == null ?"null" : restartException.GetType().ToString()) + ")", cause) { Actor = actor; - e = restartException; - exception = cause; - this.optionalMessage = optionalMessage; + RestartException = restartException; + OptionalMessage = optionalMessage; } /// @@ -402,7 +413,18 @@ public PreRestartException(IActorRef actor, Exception restartException, Exceptio protected PreRestartException(SerializationInfo info, StreamingContext context) : base(info, context) { + RestartException = (Exception)info.GetValue("RestartException", typeof(Exception)); + OptionalMessage = info.GetValue("OptionalMessage", typeof(object)); + } + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + if (info == null) throw new ArgumentNullException(nameof(info)); + info.AddValue("RestartException", RestartException); + info.AddValue("OptionalMessage", OptionalMessage); + base.GetObjectData(info, context); } + } /// @@ -411,8 +433,6 @@ protected PreRestartException(SerializationInfo info, StreamingContext context) /// public class PostRestartException : ActorInitializationException { - private readonly Exception _originalCause; - /// /// Initializes a new instance of the class. /// @@ -422,7 +442,7 @@ public class PostRestartException : ActorInitializationException public PostRestartException(IActorRef actor, Exception cause, Exception originalCause) :base(actor,"Exception post restart (" + (originalCause == null ?"null" : originalCause.GetType().ToString()) + ")", cause) { - _originalCause = originalCause; + OriginalCause = originalCause; } /// @@ -433,12 +453,20 @@ public PostRestartException(IActorRef actor, Exception cause, Exception original protected PostRestartException(SerializationInfo info, StreamingContext context) : base(info, context) { + OriginalCause = (Exception)info.GetValue("OriginalCause", typeof(Exception)); + } + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + if (info == null) throw new ArgumentNullException(nameof(info)); + info.AddValue("OriginalCause", OriginalCause); + base.GetObjectData(info, context); } /// /// Retrieves the exception which caused the restart in the first place. /// - public Exception OriginalCause { get { return _originalCause; } } + public Exception OriginalCause { get; } } /// diff --git a/src/core/Akka/Actor/Scheduler/SchedulerException.cs b/src/core/Akka/Actor/Scheduler/SchedulerException.cs index 7c110e01b12..a107bc0b936 100644 --- a/src/core/Akka/Actor/Scheduler/SchedulerException.cs +++ b/src/core/Akka/Actor/Scheduler/SchedulerException.cs @@ -5,6 +5,8 @@ // //----------------------------------------------------------------------- +using System.Runtime.Serialization; + namespace Akka.Actor { /// @@ -18,6 +20,16 @@ public sealed class SchedulerException : AkkaException /// /// The message that describes the error. public SchedulerException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected SchedulerException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } } diff --git a/src/core/Akka/Dispatch/ExecutorService.cs b/src/core/Akka/Dispatch/ExecutorService.cs index adc68395b89..6864e970b86 100644 --- a/src/core/Akka/Dispatch/ExecutorService.cs +++ b/src/core/Akka/Dispatch/ExecutorService.cs @@ -6,6 +6,7 @@ //----------------------------------------------------------------------- using System; +using System.Runtime.Serialization; using Akka.Actor; using Akka.Annotations; @@ -70,6 +71,13 @@ public class RejectedExecutionException : AkkaException /// TBD /// TBD public RejectedExecutionException(string message = null, Exception inner = null) : base(message, inner) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected RejectedExecutionException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } diff --git a/src/core/Akka/IO/Buffers/DirectBufferPool.cs b/src/core/Akka/IO/Buffers/DirectBufferPool.cs index 48095da2706..1e5315913bc 100644 --- a/src/core/Akka/IO/Buffers/DirectBufferPool.cs +++ b/src/core/Akka/IO/Buffers/DirectBufferPool.cs @@ -21,6 +21,16 @@ public class BufferPoolAllocationException : AkkaException public BufferPoolAllocationException(string message) : base(message) { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected BufferPoolAllocationException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } } /// diff --git a/src/core/Akka/Pattern/OpenCircuitException.cs b/src/core/Akka/Pattern/OpenCircuitException.cs index 0f17fee2a79..14ebda07378 100644 --- a/src/core/Akka/Pattern/OpenCircuitException.cs +++ b/src/core/Akka/Pattern/OpenCircuitException.cs @@ -90,6 +90,15 @@ public OpenCircuitException(Exception cause, TimeSpan remainingDuration) protected OpenCircuitException(SerializationInfo info, StreamingContext context) : base(info, context) { + var duration = (string)info.GetValue("RemainingDuration", typeof(string)); + RemainingDuration = TimeSpan.Parse(duration); + } + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + if (info == null) throw new ArgumentNullException(nameof(info)); + info.AddValue("RemainingDuration", RemainingDuration); + base.GetObjectData(info, context); } } } diff --git a/src/core/Akka/Pattern/UserCalledFailException.cs b/src/core/Akka/Pattern/UserCalledFailException.cs index b07fa431fa4..86260140a3e 100644 --- a/src/core/Akka/Pattern/UserCalledFailException.cs +++ b/src/core/Akka/Pattern/UserCalledFailException.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Runtime.Serialization; using System.Text; using Akka.Actor; @@ -16,5 +17,12 @@ public class UserCalledFailException : AkkaException { public UserCalledFailException() : base($"User code caused [{nameof(CircuitBreaker)}] to fail because it calls the [{nameof(CircuitBreaker.Fail)}()] method.") { } + + /// + /// Initializes a new instance of the class. + /// + /// The that holds the serialized object data about the exception being thrown. + /// The that contains contextual information about the source or destination. + protected UserCalledFailException(SerializationInfo info, StreamingContext context) : base(info, context) { } } } From f6a5df888f1a0ccf4e2ad81e7f9867e9f8bb9317 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 17 Apr 2021 03:13:35 +0700 Subject: [PATCH 08/13] Add support to wrap exceptions in custom fields for ExceptionSupport --- .../Serialization/ExceptionSupport.cs | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/core/Akka.Remote/Serialization/ExceptionSupport.cs b/src/core/Akka.Remote/Serialization/ExceptionSupport.cs index fd4863a9bbf..52e6a2b89ab 100644 --- a/src/core/Akka.Remote/Serialization/ExceptionSupport.cs +++ b/src/core/Akka.Remote/Serialization/ExceptionSupport.cs @@ -14,6 +14,7 @@ using Akka.Util.Internal; using Google.Protobuf; using System.Runtime.Serialization; +using Akka.Remote.Serialization.Proto.Msg; namespace Akka.Remote.Serialization { @@ -21,7 +22,7 @@ internal class ExceptionSupport { private readonly WrappedPayloadSupport _wrappedPayloadSupport; private const BindingFlags All = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public; - private HashSet DefaultProperties = new HashSet + private readonly HashSet _defaultProperties = new HashSet { "ClassName", "Message", @@ -66,7 +67,7 @@ internal Exception ExceptionFromProto(Proto.Msg.ExceptionData proto) return ExceptionFromProtoNet(proto); } - private FormatterConverter DefaultFormatterConverter = new FormatterConverter(); + private readonly FormatterConverter _defaultFormatterConverter = new FormatterConverter(); public Proto.Msg.ExceptionData ExceptionToProtoNet(Exception exception) { @@ -84,14 +85,22 @@ public Proto.Msg.ExceptionData ExceptionToProtoNet(Exception exception) message.InnerException = ExceptionToProto(exception.InnerException); var serializable = exception as ISerializable; - var serializationInfo = new SerializationInfo(exceptionType, DefaultFormatterConverter); + var serializationInfo = new SerializationInfo(exceptionType, _defaultFormatterConverter); serializable.GetObjectData(serializationInfo, new StreamingContext()); foreach (var info in serializationInfo) { - if (DefaultProperties.Contains(info.Name)) continue; - var preparedValue = _wrappedPayloadSupport.PayloadToProto(info.Value); - message.CustomFields.Add(info.Name, preparedValue); + if (_defaultProperties.Contains(info.Name)) continue; + if (info.Value is Exception exceptionValue) + { + var exceptionPayload = ExceptionToProto(exceptionValue); + var preparedValue = _wrappedPayloadSupport.PayloadToProto(exceptionPayload); + message.CustomFields.Add(info.Name, preparedValue); + } else + { + var preparedValue = _wrappedPayloadSupport.PayloadToProto(info.Value); + message.CustomFields.Add(info.Name, preparedValue); + } } return message; @@ -104,22 +113,25 @@ public Exception ExceptionFromProtoNet(Proto.Msg.ExceptionData proto) Type exceptionType = Type.GetType(proto.TypeName); - var serializationInfo = new SerializationInfo(exceptionType, DefaultFormatterConverter); + var serializationInfo = new SerializationInfo(exceptionType, _defaultFormatterConverter); serializationInfo.AddValue("ClassName", proto.TypeName); - serializationInfo.AddValue("Message", proto.Message); - serializationInfo.AddValue("StackTraceString", proto.StackTrace); - serializationInfo.AddValue("Source", proto.Source); + serializationInfo.AddValue("Message", ValueOrNull(proto.Message)); + serializationInfo.AddValue("StackTraceString", ValueOrNull(proto.StackTrace)); + serializationInfo.AddValue("Source", ValueOrNull(proto.Source)); serializationInfo.AddValue("InnerException", ExceptionFromProto(proto.InnerException)); serializationInfo.AddValue("HelpURL", string.Empty); - serializationInfo.AddValue("RemoteStackTraceString", string.Empty); + serializationInfo.AddValue("RemoteStackTraceString", null); serializationInfo.AddValue("RemoteStackIndex", 0); - serializationInfo.AddValue("ExceptionMethod", string.Empty); + serializationInfo.AddValue("ExceptionMethod", null); serializationInfo.AddValue("HResult", int.MinValue); foreach (var field in proto.CustomFields) { - serializationInfo.AddValue(field.Key, _wrappedPayloadSupport.PayloadFrom(field.Value)); + var payload = _wrappedPayloadSupport.PayloadFrom(field.Value); + if (payload is ExceptionData exception) + payload = ExceptionFromProto(exception); + serializationInfo.AddValue(field.Key, payload); } Exception obj = null; @@ -137,5 +149,8 @@ public Exception ExceptionFromProtoNet(Proto.Msg.ExceptionData proto) return obj; } + + private string ValueOrNull(string value) + => string.IsNullOrEmpty(value) ? null : value; } } From c8c4d0b69b4c820142f72c935ab79a29615203e1 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 17 Apr 2021 03:13:53 +0700 Subject: [PATCH 09/13] Add spec for ExceptionSupport --- .../Akka.Remote.Tests/ExceptionSupportSpec.cs | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 src/core/Akka.Remote.Tests/ExceptionSupportSpec.cs diff --git a/src/core/Akka.Remote.Tests/ExceptionSupportSpec.cs b/src/core/Akka.Remote.Tests/ExceptionSupportSpec.cs new file mode 100644 index 00000000000..bac4420101f --- /dev/null +++ b/src/core/Akka.Remote.Tests/ExceptionSupportSpec.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Akka.Actor; +using Akka.Configuration; +using Akka.Dispatch; +using Akka.IO.Buffers; +using Akka.Pattern; +using Akka.Remote.Serialization; +using Akka.Remote.Transport; +using Akka.Serialization; +using Akka.TestKit; +using Xunit; +using Xunit.Abstractions; +using FluentAssertions; + +namespace Akka.Remote.Tests +{ + public class ExceptionSupportSpec : AkkaSpec + { + private readonly ExceptionSupport _serializer; + private readonly Exception _innerException = new Exception("inner message"); + private readonly Exception _innerException2 = new Exception("inner message 2"); + + public ExceptionSupportSpec(ITestOutputHelper output) : base(output) + { + _serializer = new ExceptionSupport((ExtendedActorSystem)Sys); + } + + [Theory] + [InlineData(new object[]{typeof(ActorInterruptedException)})] + [InlineData(new object[]{typeof(ActorNotFoundException)})] + [InlineData(new object[]{typeof(InvalidActorNameException)})] + [InlineData(new object[]{typeof(LoggerInitializationException)})] + [InlineData(new object[]{typeof(StashOverflowException)})] + [InlineData(new object[]{typeof(ConfigurationException)})] + [InlineData(new object[]{typeof(RejectedExecutionException)})] + [InlineData(new object[]{typeof(IllegalStateException)})] + [InlineData(new object[]{typeof(RemoteTransportException)})] + [InlineData(new object[]{typeof(AkkaProtocolException)})] + [InlineData(new object[]{typeof(InvalidAssociationException)})] + public void ExceptionSupport_should_serialize_exceptions_with_inner_exception(Type type) + { + var instance = (Exception) Activator.CreateInstance(type, "TestMessage", _innerException); + AssertDefaultsEquals(instance); + } + + [Theory] + [InlineData(new object[]{typeof(ActorKilledException)})] + [InlineData(new object[]{typeof(AskTimeoutException)})] + [InlineData(new object[]{typeof(IllegalActorNameException)})] + [InlineData(new object[]{typeof(IllegalActorStateException)})] + [InlineData(new object[]{typeof(InvalidMessageException)})] + [InlineData(new object[]{typeof(SchedulerException)})] + [InlineData(new object[]{typeof(BufferPoolAllocationException)})] + public void ExceptionSupport_should_serialize_exceptions_with_message(Type type) + { + var instance = (Exception) Activator.CreateInstance(type, "TestMessage"); + AssertDefaultsEquals(instance); + } + + [Theory] + [InlineData(new object[]{typeof(UserCalledFailException)})] + public void ExceptionSupport_should_serialize_exceptions(Type type) + { + var instance = (Exception) Activator.CreateInstance(type, new object[]{}); + AssertDefaultsEquals(instance); + } + + [Fact] + public void ExceptionSupport_should_serialize_ActorInitializationException() + { + var probe = CreateTestProbe(); + var exception = AssertDefaultsEquals(new ActorInitializationException(probe.Ref, "TestMessage", _innerException)); + + exception.Actor.Should().NotBeNull(); + exception.Actor.Equals(probe).Should().BeTrue(); + } + + [Fact] + public void ExceptionSupport_should_serialize_DeathPactException() + { + var probe = CreateTestProbe(); + var exception = AssertDefaultsEquals(new DeathPactException(probe.Ref)); + + exception.DeadActor.Should().NotBeNull(); + exception.DeadActor.Equals(probe).Should().BeTrue(); + } + + [Fact] + public void ExceptionSupport_should_serialize_PostRestartException() + { + var probe = CreateTestProbe(); + var exception = AssertDefaultsEquals(new PostRestartException(probe.Ref, _innerException, _innerException2)); + + exception.Actor.Should().NotBeNull(); + exception.Actor.Equals(probe).Should().BeTrue(); + AssertExceptionEquals(_innerException2, exception.OriginalCause); + } + + [Fact] + public void ExceptionSupport_should_serialize_PreRestartException() + { + var probe = CreateTestProbe(); + var testMessage = new + { + value = 1 + }; + var exception = AssertDefaultsEquals(new PreRestartException(probe.Ref, _innerException2, _innerException, testMessage)); + + exception.Actor.Should().NotBeNull(); + exception.Actor.Equals(probe).Should().BeTrue(); + AssertExceptionEquals(_innerException2, exception.RestartException); + exception.OptionalMessage.Should().BeEquivalentTo(testMessage); + } + + [Fact] + public void ExceptionSupport_should_serialize_OpenCircuitException() + { + var remaining = new TimeSpan(1234567); + var exception = AssertDefaultsEquals(new OpenCircuitException("TestMessage", _innerException, remaining)); + + exception.RemainingDuration.Should().Be(remaining); + } + + private T AssertDefaultsEquals(T expected) where T: Exception + { + var serialized = _serializer.ExceptionToProto(expected); + var deserialized = (T)_serializer.ExceptionFromProto(serialized); + + AssertExceptionEquals(expected, deserialized); + + return deserialized; + } + + private void AssertExceptionEquals(Exception expected, Exception actual) + { + actual.Message.Should().Be(expected.Message); + // HResult is not serialized + // actual.HResult.Should().Be(expected.HResult); + actual.Source.Should().Be(expected.Source); + actual.StackTrace.Should().Be(expected.StackTrace); + actual.TargetSite.Should().BeEquivalentTo(expected.TargetSite); + if (actual.InnerException != null) + { + AssertExceptionEquals(actual.InnerException, expected.InnerException); + } + } + } +} From 3dfd0c07773cd72931334c65fe1ac9471163a633 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Sat, 17 Apr 2021 03:22:05 +0700 Subject: [PATCH 10/13] Update APIApproval list --- .../CoreAPISpec.ApproveCluster.approved.txt | 1 + ...reAPISpec.ApproveClusterTools.approved.txt | 1 + ...reAPISpec.ApproveCoordination.approved.txt | 2 ++ .../CoreAPISpec.ApproveCore.approved.txt | 33 +++++++++++++++++-- ...PISpec.ApproveDistributedData.approved.txt | 2 ++ ...oreAPISpec.ApprovePersistence.approved.txt | 4 +++ ...c.ApprovePersistenceSqlCommon.approved.txt | 1 + .../CoreAPISpec.ApproveRemote.approved.txt | 3 ++ .../CoreAPISpec.ApproveStreams.approved.txt | 28 +++++++++++++++- 9 files changed, 72 insertions(+), 3 deletions(-) diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt index f6bf19cd571..81ec68639c3 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCluster.approved.txt @@ -175,6 +175,7 @@ namespace Akka.Cluster public class ClusterJoinFailedException : Akka.Actor.AkkaException { public ClusterJoinFailedException(string message) { } + protected ClusterJoinFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class ClusterScope : Akka.Actor.Scope { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveClusterTools.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveClusterTools.approved.txt index df676d7749b..3b2fd70c621 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveClusterTools.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveClusterTools.approved.txt @@ -345,6 +345,7 @@ namespace Akka.Cluster.Tools.Singleton public sealed class ClusterSingletonManagerIsStuckException : Akka.Actor.AkkaException { public ClusterSingletonManagerIsStuckException(string message) { } + public ClusterSingletonManagerIsStuckException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class ClusterSingletonManagerSettings : Akka.Actor.INoSerializationVerificationNeeded { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCoordination.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCoordination.approved.txt index 6bda7ca1ed2..1414adb9dde 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCoordination.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCoordination.approved.txt @@ -15,6 +15,7 @@ namespace Akka.Coordination { public LeaseException(string message) { } public LeaseException(string message, System.Exception innerEx) { } + protected LeaseException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class LeaseProvider : Akka.Actor.IExtension { @@ -43,6 +44,7 @@ namespace Akka.Coordination { public LeaseTimeoutException(string message) { } public LeaseTimeoutException(string message, System.Exception innerEx) { } + protected LeaseTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class LeaseUsageSettings { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt index f308c7c1783..c3d73c35a40 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveCore.approved.txt @@ -151,21 +151,26 @@ namespace Akka.Actor public ActorInitializationException(string message) { } public ActorInitializationException(string message, System.Exception cause) { } public ActorInitializationException(Akka.Actor.IActorRef actor, string message, System.Exception cause = null) { } + protected ActorInitializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public Akka.Actor.IActorRef Actor { get; set; } + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public override string ToString() { } } public class ActorInterruptedException : Akka.Actor.AkkaException { public ActorInterruptedException(string message = null, System.Exception cause = null) { } + protected ActorInterruptedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class ActorKilledException : Akka.Actor.AkkaException { public ActorKilledException() { } public ActorKilledException(string message) { } + protected ActorKilledException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class ActorNotFoundException : Akka.Actor.AkkaException { public ActorNotFoundException() { } + protected ActorNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public ActorNotFoundException(string message, System.Exception innerException = null) { } } public abstract class ActorPath : Akka.Util.ISurrogated, System.IComparable, System.IEquatable @@ -384,7 +389,7 @@ namespace Akka.Actor where T : class, Akka.Actor.IExtension where TI : Akka.Actor.IExtensionId { } } - public sealed class Address : Akka.Util.ISurrogated, System.IComparable, System.IComparable, System.IEquatable + public sealed class Address : Akka.Util.ISurrogated, System.ICloneable, System.IComparable, System.IComparable, System.IEquatable { public static readonly Akka.Actor.Address AllSystems; public static readonly System.Collections.Generic.IComparer Comparer; @@ -424,6 +429,7 @@ namespace Akka.Actor { protected AkkaException() { } protected AkkaException(string message, System.Exception cause = null) { } + protected AkkaException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } protected System.Exception Cause { get; } } public class AllForOneStrategy : Akka.Actor.SupervisorStrategy, System.IEquatable @@ -458,6 +464,7 @@ namespace Akka.Actor public class AskTimeoutException : Akka.Actor.AkkaException { public AskTimeoutException(string message) { } + protected AskTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class BootstrapSetup : Akka.Actor.Setup.Setup { @@ -577,7 +584,9 @@ namespace Akka.Actor public class DeathPactException : Akka.Actor.AkkaException { public DeathPactException(Akka.Actor.IActorRef deadActor) { } + protected DeathPactException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public Akka.Actor.IActorRef DeadActor { get; } + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static Decider { @@ -1160,10 +1169,12 @@ namespace Akka.Actor public class IllegalActorNameException : Akka.Actor.AkkaException { public IllegalActorNameException(string message) { } + protected IllegalActorNameException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class IllegalActorStateException : Akka.Actor.AkkaException { public IllegalActorStateException(string message) { } + protected IllegalActorStateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class Inbox : Akka.Actor.ICanWatch, Akka.Actor.IInboxable, System.IDisposable { @@ -1204,11 +1215,13 @@ namespace Akka.Actor { public InvalidActorNameException(string message) { } public InvalidActorNameException(string message, System.Exception innerException) { } + protected InvalidActorNameException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class InvalidMessageException : Akka.Actor.AkkaException { public InvalidMessageException() { } public InvalidMessageException(string message) { } + protected InvalidMessageException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class Kill : Akka.Actor.IAutoReceivedMessage { @@ -1293,6 +1306,7 @@ namespace Akka.Actor public LoggerInitializationException() { } public LoggerInitializationException(string message) { } public LoggerInitializationException(string message, System.Exception cause = null) { } + protected LoggerInitializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } [Akka.Annotations.InternalApiAttribute()] public abstract class MinimalActorRef : Akka.Actor.InternalActorRefBase, Akka.Actor.IActorRefScope @@ -1374,11 +1388,17 @@ namespace Akka.Actor public class PostRestartException : Akka.Actor.ActorInitializationException { public PostRestartException(Akka.Actor.IActorRef actor, System.Exception cause, System.Exception originalCause) { } + protected PostRestartException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public System.Exception OriginalCause { get; } + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public class PreRestartException : Akka.Actor.AkkaException + public class PreRestartException : Akka.Actor.ActorInitializationException { public PreRestartException(Akka.Actor.IActorRef actor, System.Exception restartException, System.Exception cause, object optionalMessage) { } + protected PreRestartException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + public object OptionalMessage { get; } + public System.Exception RestartException { get; } + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class Props : Akka.Util.ISurrogated, System.IEquatable { @@ -1577,6 +1597,7 @@ namespace Akka.Actor public sealed class SchedulerException : Akka.Actor.AkkaException { public SchedulerException(string message) { } + protected SchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static SchedulerExtensions { @@ -1690,6 +1711,7 @@ namespace Akka.Actor public class StashOverflowException : Akka.Actor.AkkaException { public StashOverflowException(string message, System.Exception cause = null) { } + protected StashOverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public abstract class Status { @@ -2204,6 +2226,7 @@ namespace Akka.Configuration { public ConfigurationException(string message) { } public ConfigurationException(string message, System.Exception exception) { } + protected ConfigurationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public static Akka.Configuration.ConfigurationException NullOrEmptyConfig(string path = null) { } } public class ConfigurationFactory @@ -2640,6 +2663,7 @@ namespace Akka.Dispatch public class RejectedExecutionException : Akka.Actor.AkkaException { public RejectedExecutionException(string message = null, System.Exception inner = null) { } + protected RejectedExecutionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class ThreadPoolConfig { @@ -3190,6 +3214,7 @@ namespace Akka.IO.Buffers public class BufferPoolAllocationException : Akka.Actor.AkkaException { public BufferPoolAllocationException(string message) { } + protected BufferPoolAllocationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public interface IBufferPool { @@ -3971,6 +3996,7 @@ namespace Akka.Pattern { public IllegalStateException(string message) { } public IllegalStateException(string message, System.Exception innerEx) { } + protected IllegalStateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class OpenCircuitException : Akka.Actor.AkkaException { @@ -3981,11 +4007,14 @@ namespace Akka.Pattern public OpenCircuitException(string message, System.Exception cause, System.TimeSpan remainingDuration) { } public OpenCircuitException(System.Exception cause) { } public OpenCircuitException(System.Exception cause, System.TimeSpan remainingDuration) { } + protected OpenCircuitException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public System.TimeSpan RemainingDuration { get; } + public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class UserCalledFailException : Akka.Actor.AkkaException { public UserCalledFailException() { } + protected UserCalledFailException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } } namespace Akka.Routing diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveDistributedData.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveDistributedData.approved.txt index 2c018f0f93d..0d1d5244bc2 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveDistributedData.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveDistributedData.approved.txt @@ -42,6 +42,7 @@ namespace Akka.DistributedData public class DataDeletedException : System.Exception { public DataDeletedException(string message) { } + protected DataDeletedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class Delete : Akka.Actor.INoSerializationVerificationNeeded, System.IEquatable { @@ -981,6 +982,7 @@ namespace Akka.DistributedData.Durable { public LoadFailedException(string message) { } public LoadFailedException(string message, System.Exception cause) { } + public LoadFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class Store { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistence.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistence.approved.txt index 11c5c2a144d..44dce9a7cb9 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistence.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistence.approved.txt @@ -362,6 +362,7 @@ namespace Akka.Persistence public MaxUnconfirmedMessagesExceededException() { } public MaxUnconfirmedMessagesExceededException(string message) { } public MaxUnconfirmedMessagesExceededException(string message, System.Exception innerException) { } + protected MaxUnconfirmedMessagesExceededException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class Persistence : Akka.Actor.ExtensionIdProvider { @@ -505,6 +506,7 @@ namespace Akka.Persistence { public RecoveryTimedOutException() { } public RecoveryTimedOutException(string message, System.Exception cause = null) { } + public RecoveryTimedOutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class ReplayMessages : Akka.Actor.INoSerializationVerificationNeeded, Akka.Persistence.IJournalMessage, Akka.Persistence.IJournalRequest, Akka.Persistence.IPersistenceMessage, System.IEquatable { @@ -827,6 +829,7 @@ namespace Akka.Persistence.Journal { public AsyncReplayTimeoutException() { } public AsyncReplayTimeoutException(string message) { } + protected AsyncReplayTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public abstract class AsyncWriteJournal : Akka.Persistence.Journal.WriteJournalBase, Akka.Persistence.Journal.IAsyncRecovery { @@ -1109,6 +1112,7 @@ namespace Akka.Persistence.Snapshot public NoSnapshotStoreException() { } public NoSnapshotStoreException(string message) { } public NoSnapshotStoreException(string message, System.Exception innerException) { } + protected NoSnapshotStoreException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } } public class SnapshotEntry diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistenceSqlCommon.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistenceSqlCommon.approved.txt index 33f960fce76..931a7dcbc88 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistenceSqlCommon.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApprovePersistenceSqlCommon.approved.txt @@ -188,6 +188,7 @@ namespace Akka.Persistence.Sql.Common.Journal { public static readonly Akka.Persistence.Sql.Common.Journal.JournalBufferOverflowException Instance; public JournalBufferOverflowException() { } + protected JournalBufferOverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class JournalEntry { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt index f3fc63faff7..e19509715cb 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveRemote.approved.txt @@ -284,6 +284,7 @@ namespace Akka.Remote public class RemoteTransportException : Akka.Actor.AkkaException { public RemoteTransportException(string message, System.Exception cause = null) { } + protected RemoteTransportException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class RemoteWatcher : Akka.Actor.UntypedActor, Akka.Dispatch.IRequiresMessageQueue { @@ -502,6 +503,7 @@ namespace Akka.Remote.Transport public class AkkaProtocolException : Akka.Actor.AkkaException { public AkkaProtocolException(string message, System.Exception cause = null) { } + protected AkkaProtocolException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class AssociateAttempt : Akka.Remote.Transport.Activity { @@ -602,6 +604,7 @@ namespace Akka.Remote.Transport public class InvalidAssociationException : Akka.Actor.AkkaException { public InvalidAssociationException(string message, System.Exception cause = null) { } + protected InvalidAssociationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class ListenAttempt : Akka.Remote.Transport.Activity { diff --git a/src/core/Akka.API.Tests/CoreAPISpec.ApproveStreams.approved.txt b/src/core/Akka.API.Tests/CoreAPISpec.ApproveStreams.approved.txt index 1e1b438b049..340aedc035e 100644 --- a/src/core/Akka.API.Tests/CoreAPISpec.ApproveStreams.approved.txt +++ b/src/core/Akka.API.Tests/CoreAPISpec.ApproveStreams.approved.txt @@ -12,11 +12,13 @@ namespace Akka.Streams public sealed class AbruptStageTerminationException : System.Exception { public AbruptStageTerminationException(Akka.Streams.Stage.GraphStageLogic logic) { } + protected AbruptStageTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class AbruptTerminationException : System.Exception { public readonly Akka.Actor.IActorRef Actor; public AbruptTerminationException(Akka.Actor.IActorRef actor) { } + protected AbruptTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static ActorAttributes { @@ -280,11 +282,13 @@ namespace Akka.Streams public class BindFailedException : Akka.Streams.StreamTcpException { public static readonly Akka.Streams.BindFailedException Instance; + protected BindFailedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class BufferOverflowException : System.Exception { public BufferOverflowException(string message) { } public BufferOverflowException(string message, System.Exception innerException) { } + protected BufferOverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class ClosedShape : Akka.Streams.Shape { @@ -298,6 +302,7 @@ namespace Akka.Streams { public ConnectionException(string message) { } public ConnectionException(string message, System.Exception innerException) { } + protected ConnectionException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static Construct { @@ -757,12 +762,14 @@ namespace Akka.Streams public sealed class InvalidPartnerActorException : Akka.Pattern.IllegalStateException { public InvalidPartnerActorException(Akka.Actor.IActorRef expectedRef, Akka.Actor.IActorRef gotRef, string message) { } + protected InvalidPartnerActorException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public Akka.Actor.IActorRef ExpectedRef { get; } public Akka.Actor.IActorRef GotRef { get; } } public sealed class InvalidSequenceNumberException : Akka.Pattern.IllegalStateException { public InvalidSequenceNumberException(long expectedSeqNr, long gotSeqNr, string message) { } + protected InvalidSequenceNumberException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public long ExpectedSeqNr { get; } public long GotSeqNr { get; } } @@ -783,6 +790,7 @@ namespace Akka.Streams public class MaterializationException : System.Exception { public MaterializationException(string message, System.Exception innerException) { } + protected MaterializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class NoMaterializer : Akka.Streams.IMaterializer { @@ -797,6 +805,7 @@ namespace Akka.Streams public class NoSuchElementException : System.Exception { public NoSuchElementException(string message) { } + protected NoSuchElementException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public abstract class OutPort { @@ -848,8 +857,9 @@ namespace Akka.Streams public sealed class RemoteStreamRefActorTerminatedException : System.Exception { public RemoteStreamRefActorTerminatedException(string message) { } + protected RemoteStreamRefActorTerminatedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } - public abstract class Shape + public abstract class Shape : System.ICloneable { protected Shape() { } public abstract System.Collections.Immutable.ImmutableArray Inlets { get; } @@ -893,6 +903,7 @@ namespace Akka.Streams public class StreamLimitReachedException : System.Exception { public StreamLimitReachedException(long max) { } + protected StreamLimitReachedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static StreamRefAttributes { @@ -941,6 +952,7 @@ namespace Akka.Streams public sealed class StreamRefSubscriptionTimeoutException : Akka.Pattern.IllegalStateException { public StreamRefSubscriptionTimeoutException(string message) { } + protected StreamRefSubscriptionTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public sealed class StreamSubscriptionTimeoutSettings : System.IEquatable { @@ -963,6 +975,7 @@ namespace Akka.Streams { public StreamTcpException(string message) { } public StreamTcpException(string message, System.Exception innerException) { } + protected StreamTcpException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public enum SubstreamCancelStrategy { @@ -972,6 +985,7 @@ namespace Akka.Streams public sealed class TargetRefNotInitializedYetException : Akka.Pattern.IllegalStateException { public TargetRefNotInitializedYetException() { } + protected TargetRefNotInitializedYetException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public enum ThrottleMode { @@ -1017,6 +1031,7 @@ namespace Akka.Streams public class WatchedActorTerminatedException : Akka.Actor.AkkaException { public WatchedActorTerminatedException(string stageName, Akka.Actor.IActorRef actorRef) { } + protected WatchedActorTerminatedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } } namespace Akka.Streams.Actors @@ -1454,6 +1469,7 @@ namespace Akka.Streams.Dsl public class FramingException : System.Exception { public FramingException(string message) { } + protected FramingException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } } public class static GraphDsl @@ -1688,6 +1704,7 @@ namespace Akka.Streams.Dsl public class OutputTruncationException : System.Exception { public OutputTruncationException() { } + protected OutputTruncationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class static PagedSource { @@ -1718,6 +1735,7 @@ namespace Akka.Streams.Dsl public sealed class PartitionOutOfBoundsException : System.Exception { public PartitionOutOfBoundsException(string message) { } + protected PartitionOutOfBoundsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class PartitionWith : Akka.Streams.Stage.GraphStage> { @@ -2205,6 +2223,7 @@ namespace Akka.Streams.Dsl public sealed class TcpIdleTimeoutException : System.TimeoutException { public TcpIdleTimeoutException(string message, System.TimeSpan duration) { } + protected TcpIdleTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } public System.TimeSpan Duration { get; } } public class static TcpStreamExtensions @@ -2219,6 +2238,7 @@ namespace Akka.Streams.Dsl public class UnexpectedOutputException : System.Exception { public UnexpectedOutputException(object element) { } + protected UnexpectedOutputException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class UnzipWith { @@ -3160,6 +3180,7 @@ namespace Akka.Streams.Implementation public class MaterializationPanicException : System.Exception { public MaterializationPanicException(System.Exception innerException) { } + protected MaterializationPanicException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } } [Akka.Annotations.InternalApiAttribute()] @@ -3218,10 +3239,12 @@ namespace Akka.Streams.Implementation public class NormalShutdownException : Akka.Pattern.IllegalStateException { public NormalShutdownException(string message) { } + protected NormalShutdownException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class NothingToReadException : System.Exception { public static readonly Akka.Streams.Implementation.NothingToReadException Instance; + protected NothingToReadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class OutputBunch { @@ -3382,6 +3405,7 @@ namespace Akka.Streams.Implementation public class SignalThrewException : Akka.Pattern.IllegalStateException, Akka.Streams.Implementation.ISpecViolation { public SignalThrewException(string message, System.Exception cause) { } + protected SignalThrewException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public class SimpleOutputs { @@ -3580,6 +3604,7 @@ namespace Akka.Streams.Implementation { public SubscriptionTimeoutException(string message) { } public SubscriptionTimeoutException(string message, System.Exception innerException) { } + protected SubscriptionTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } [Akka.Annotations.InternalApiAttribute()] public class Throttle : Akka.Streams.Implementation.Fusing.SimpleLinearGraphStage @@ -4838,6 +4863,7 @@ namespace Akka.Streams.Stage public class StageActorRefNotInitializedException : System.Exception { public static readonly Akka.Streams.Stage.StageActorRefNotInitializedException Instance; + protected StageActorRefNotInitializedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } } public abstract class StageState { From c34b2a6f2f3f4c3272a6724e036293f456223d34 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Tue, 20 Apr 2021 22:23:34 +0700 Subject: [PATCH 11/13] Fix flaky spec --- src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs index 91d3060d585..7f057787a57 100644 --- a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs +++ b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs @@ -82,7 +82,6 @@ public async Task ForkJoinExecutorShouldShutdownUponActorSystemTermination() threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); - threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); await Sys.Terminate(); AwaitAssert(() => From 68cc15bc7fc4f8245cad3b2dbb9035278e063507 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Wed, 5 May 2021 22:47:54 +0700 Subject: [PATCH 12/13] Revert "Fix flaky spec" This reverts commit c34b2a6f2f3f4c3272a6724e036293f456223d34. --- src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs index 7f057787a57..91d3060d585 100644 --- a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs +++ b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs @@ -82,6 +82,7 @@ public async Task ForkJoinExecutorShouldShutdownUponActorSystemTermination() threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); + threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); await Sys.Terminate(); AwaitAssert(() => From 0956e761139e066826599fb341cf49fd74e98884 Mon Sep 17 00:00:00 2001 From: Gregorius Soedharmo Date: Wed, 5 May 2021 23:26:52 +0700 Subject: [PATCH 13/13] Fix flaky tests --- src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs index 91d3060d585..73a4980df0d 100644 --- a/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs +++ b/src/core/Akka.Tests/Actor/Dispatch/Bug2640Spec.cs @@ -82,7 +82,6 @@ public async Task ForkJoinExecutorShouldShutdownUponActorSystemTermination() threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); - threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); await Sys.Terminate(); AwaitAssert(() => @@ -102,7 +101,6 @@ public void ForkJoinExecutorShouldShutdownUponAllActorsTerminating() threads = ReceiveN(100).Cast().GroupBy(x => x.ManagedThreadId) .ToDictionary(x => x.Key, grouping => grouping.First()); - threads.Count.Should().Be(4, "Expected 4 distinct threads in this example"); Sys.Stop(actor); ExpectTerminated(actor);