github dotnet/orleans v10.4.1

5 hours ago

Orleans 10.4.1

Orleans 10.4.1 improves cluster membership, grain scheduling, graceful shutdown, client startup, serialization, and provider reliability. It also restores standalone serializer code generation, fixes ADO.NET streaming message loss, and improves dashboard statistics and navigation.

Compatibility and upgrade notes

Important

Public API compatibility: SiloAddress.GetUniformHashCodes(int) now returns ImmutableArray<uint> instead of uint[]. This is a source- and binary-breaking change for code which calls this method. Rebuild affected applications and libraries against 10.4.1. Use ToArray() when a mutable array is required, or Sort() for an immutable sorted result. See #11425.

  • Distributed grain directory: Preserve the cluster's existing partition count and ordered partition boundaries throughout an upgrade. The new GrainDirectoryOptions.GetPartitionBoundaries callback supports configuring the mapping used by an existing cluster, including the older sorted-hash mapping. Partition defaults remain unchanged. See #11425.
  • Management deactivation: Begin using the new IManagementGrain.DeactivateGrain operation after all active silos have been upgraded to support it. See #11483.
  • Custom consistent-ring configurations: Clusters using UseVirtualBucketsConsistentRing = false receive corrected request routing. During a rolling upgrade, older callers can still route reminder operations to the wrong owner. Persisted reminders are reconciled on the owner's next successful refresh, which defaults to five minutes; early occurrences can be missed before reconciliation. Custom grain services using this ring need application-specific upgrade handling. The default virtual-buckets provider retains its existing behavior. See #11598.

What's changed

The release preparation PR, #11566, bundles multiple backports. Those changes are expanded below, with links to their original PRs alongside the subsequent 10.x fixes.

Grain execution and graceful shutdown

  • Preserve read-only scheduling isolation. Request admission accounts for every active request's interleaving policy, keeping writable requests isolated from active [ReadOnly] requests and correctly handling mixed MayInterleave workloads. #10809
  • Make grain timer scheduling consistent. Timer ticks coalesce while a callback is queued or running, delayed wakeups are preserved, and Change calls made during that interval apply the latest schedule after the callback completes. #11464
  • Carry queued requests with migrating activations. Graceful silo retirement and explicit activation migration transfer eligible queued requests through normal destination admission. Best-effort caller retargeting reduces SiloUnavailableException failures when a retiring silo departs, while preserving callers' original deadlines. Applications should continue to account for ambiguous outcomes when an acceptance acknowledgement is lost. #11460
  • Run observer-level incoming call filters. Filters implemented by observer objects participate in incoming call processing. #11507
  • Safely deactivate existing grain instances. IManagementGrain.DeactivateGrain(GrainId, CancellationToken) locates existing activations directly and waits for their deactivation callbacks. This supports lifecycle operations on grains whose persisted state cannot currently be read. #11483

Cluster membership, directories, and Kubernetes

  • Preserve the default grain directory when registering a named distributed directory. Grains continue to use their configured directory, fixing duplicate activations caused by the registration interaction. #11553
  • Keep membership snapshots canonical and retain departed-silo knowledge. Local startup lifecycle tracking remains separate from published membership rows. Retained death information lets client routing and durable-job adoption account for silos after their rows are pruned. Snapshot decoding also supports older silos which omit the new history field. #11593
  • Improve membership health monitoring. Health monitors handle shutdown cancellation cleanly, and joining silos reevaluate stale peers. #11421, #11431
  • Upgrade legacy Azure Table membership data safely. Existing legacy tables can be read with their versions and ETags intact. The first successful membership write atomically establishes the snapshot boundary markers, and reads retry when they overlap marker installation. #11596
  • Read Firestore membership rows atomically. The silo row and membership version are read from the same transactional snapshot during concurrent updates. #11400
  • Route Redis membership and directory operations to the primary. Primary routing provides current membership and registration state and avoids replica write failures during reconnection. #11484
  • Keep elected Kubernetes agents monitoring. Membership updates preserve the elected agent's pod watch and dead-silo pod cleanup; election handoffs and shutdown coordinate pending monitor wakeups. #11600
  • Update KubernetesClient to 21.0.8, with a supported dependency range of [21.0.8,22.0.0). #11503
  • Align consistent-ring routing with published ownership ranges, including unsigned hash positions, range endpoints, and wraparound. #11598

Client startup and storage cancellation

  • Honor client startup cancellation throughout initialization. Cancellation reaches gateway-provider initialization, discovery, connection attempts, retry decisions, and initial cluster-manifest retrieval. A cancelled start releases owned startup resources before completing. After successful startup, background refreshes follow the client's lifetime token. Existing gateway providers remain supported through default implementations of the new cancellation-aware methods. #11605
  • Forward storage cancellation tokens through ADO.NET, Azure Blob, Azure Table, Cosmos DB, DynamoDB, and Firestore grain storage operations. #11410, #11411, #11412, #11413, #11414, #11415

Serialization and packaging

  • Restore standalone serializer code generation. Projects referencing Microsoft.Orleans.Serialization receive the transitive source-generator and analyzer dependencies needed for [GenerateSerializer] types, fixing runtime CodecNotFoundException failures caused by missing generated codecs. #11603
  • Deserialize empty multidimensional arrays correctly. #11430
  • Enforce Arc buffer bounds and lifetime rules. Fixes cover empty buffers, page-backed slices, disposal checks, consecutive empty pages, and nested reader forks. #11474
  • Tighten type resolution and authorization. Assembly-qualified lookup respects the specified assembly, and generic type definitions require their own authorization while explicit argument denials remain authoritative. #11456
  • Update MessagePack to 3.1.11, incorporating nested-array, regex backtracking, and LZ4 integer-overflow security fixes. #11519

Streaming

  • Prevent ADO.NET stream message loss during out-of-order dequeue and redelivery. Cache sequence tokens follow dequeue positions, keeping older or redelivered messages reachable by consumers. Confirmation batches deduplicate message IDs and retain the highest dequeue count. The fix uses the existing database schema and SQL scripts. #11527
  • Give each Event Hubs buffer pool a unique monitoring identity. Each cache factory retains its pool ID across partitions and cache recreation, while separate factories receive distinct IDs. #11601

Dashboard, samples, and release infrastructure

  • Restore dashboard silo statistics and counter refresh. Connected-client counts come from the gateway, byte totals come from dashboard-collected metrics, and counters refresh on the dashboard interval. Narrow-screen navigation gains an accessible sidebar toggle and keyboard dismissal. #11493
  • Update repository and sample dependencies, including patched cryptography dependencies for SqlClient-based tests and benchmarks, and simplify the ChatRoom sample's dependencies. #11497, #11519, #11445
  • Refresh package-validation and documentation-build configuration, extend CI coverage to the 10.x maintenance branch, and install a supported NuGet client for API-key publishing. #11566, #11619

Full changelog: v10.4.0...v10.4.1

Don't miss a new orleans release

NewReleases is sending notifications on new releases.