pjfanning opened a new pull request, #2783:
URL: https://github.com/apache/pekko/pull/2783

   Part of #2730
   
   See #2782 
   
   Ports https://github.com/akka/akka-core/pull/31859 — improves the 
`StopShards` coordinator command with proper guards, correctness fixes, and 
serialization support.
   
   ## ShardCoordinator changes
   - **Guard: `rememberEntities`** — logs error and ignores `StopShards` 
(incompatible combination)
   - **Guard: no known regions / shutting down** — logs warning and ignores 
instead of silently misbehaving
   - **Immediate ack for already-stopped shards** — sends `ShardStopped` 
immediately rather than hanging
   - **Skip already-rebalancing shards** — avoids double-stopping; they'll ack 
when rebalance completes
   - **Timeout mechanism** — `StopShardTimeout` cleans up waiting actors after 
`handOffTimeout` elapses
   
   ## Serialization
   Added protobuf serialization for `StopShards` so the command can be sent 
across nodes (e.g., from a `ShardRegion` proxy to the coordinator):
   - Added `StopShards` message to `ClusterShardingMessages.proto`
   - Updated generated `ClusterShardingMessages.java`
   - Added `"ST"` manifest + `stopShardsToProto`/`stopShardsFromBinary` to 
`ClusterShardingMessageSerializer`
   
   ## Tests
   - `StopShardsSpec` — 2-node cluster test verifying full stop flow including 
`ShardStopped` acks and entity termination
   - `ClusterShardingMessageSerializerSpec` — serialization roundtrip for 
`StopShards`
   
   ## Usage
   ```scala
   // Send from any node (via ShardRegion proxy or directly to coordinator)
   shardRegion ! ShardCoordinator.Internal.StopShards(Set("shard-1", "shard-2"))
   // Receive one ShardStopped per shard once stopped
   expectMsgType[ShardStopped]
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to