Improvements and bug fixes since 1.5.2
-
Breaking changes
- Most packages are now targetting .NET Standard 2.0 (which mean they can be used from either .NET Framework or .NET Core 2.0).
- These packages still target .NET Framework 4.6.1:
Microsoft.Orleans.TestingSiloHost,Microsoft.Orleans.ServiceFabric,Microsoft.Orleans.OrleansTelemetryConsumers.Counters,Microsoft.Orleans.OrleansTelemetryConsumers.NewRelicand the PowerShell module.
- These packages still target .NET Framework 4.6.1:
- Deprecated the Orleans Logging infrastructure.
- Orleans now uses the
Microsoft.Extensions.Loggingabstractions package (MEL for short from now on). - The legacy Orleans'
Loggerabstraction is preserved as obsolete for backwards compatibility in a newMicrosoft.Orleans.Logging.Legacypackage, but it's just a wrapper that forwards toILoggerfrom MEL. It is recommended that you migrate to it directly. - This package also contains a provider for the new MEL abstraction that allows forwarding to
ILogConsumer, in case the end-user has a custom implementation of that legacy interface. Similarly, it is recommended to rewrite the custom log consumer or telemetry consumer and implementILoggerProviderfrom MEL instead. - The APM methods (TrackXXX) from
Loggerwere separated into a newITelemetryProducerinterface, and it's currently only being used by Orleans to publish metrics. #3390 - Logging configuration is no longer parsed from the XML configuration, as the user would have to configure MEL instead.
- Orleans now uses the
- Created a
Microsoft.Orleans.Core.Abstractionsnuget package and moved/refactored several types into it. We plan to rev and do breaking changes to this package very infrequently. - NuGet package names were preserved for beta1, but several DLL filenames were renamed.
- Runtime code generation was removed (
Microsoft.Orleans.OrleansCodeGeneratorpackage). You should use build-time codegen by installing theMicrosoft.Orleans.OrleansCodeGenerator.Buildpackage in the grain implementations' and interfaces' projects. SiloHostBuilderandClientBuilderare intended to replace the previous ways of initializing Orleans. They are not at 100% parity withClusterConfigurationandClientConfigurationso these are still required for beta1, but they will be eventually deprecated.- Note that when using
SiloHostBuilderandClientBuilder, Orleans will no longer scan every single assembly loaded in the AppDomain by default, and instead you need to be explicit to which ones you use by calling theAddApplicationPartXXXmethods from each of the builders. - Silo membership (and its counterpart Gateway List Provider on the client) and
MessagingOptionscan be configured using the utilities in theMicrosoft.Extensions.Optionspackage. Before the final 2.0.0 release, the plan is to have everything moved to that configuration infrastructure. - Upgraded several dependencies to external packages that are .NET Standard compatible
- Add support for Scoped services. This means that each grain activation gets its own scoped service provider, and Orleans registers
IGrainActivationContextthat can be injected into Transient or Scoped service to get access to activation specific information and lifecycle events #2856 #3270 #3385 - Propagate failures in
Grain.OnActivateAsyncto callers #3315 - Removed obsolete
GrainStateclass #3167
- Most packages are now targetting .NET Standard 2.0 (which mean they can be used from either .NET Framework or .NET Core 2.0).
-
Non-breaking improvements
- Build-time codegen and silo startup have been hugely improved so that the expensive type discovery happens during build, but at startup it is very fast. This can remove several seconds to startup time, which can be especially noticeable when using
TestClusterto spin up in-memory clusters all the time #3518 - Add commit hash information in published assemblies #3575
- First version of Transactions support (still experimental, and will change in the future, not necessarily back-compatible when it does). Docs coming soon.
- Fast path for message addressing #3119
- Add extension for one-way grain calls #3224
- Google PubSub Stream provider #3210
- Lease based queue balancer for streams #3196 #3237 #3333
- Allow localhost connection in AWS SQS Storage provider #3485
- Build-time codegen and silo startup have been hugely improved so that the expensive type discovery happens during build, but at startup it is very fast. This can remove several seconds to startup time, which can be especially noticeable when using
-
Non-breaking bug fixes
- Fix occasional NullReferenceException during silo shutdown #3328
- Avoid serializing delegates and other non-portable types #3240
- ServiceFabric membership: ensure all silos reach a terminal state #3568
- Limit RequestContext to messaging layer. It is technically a change in behavior, but not one that end users could have relied upon, but listing it here in case someone notices side-effects due to this #3546