He-Pin opened a new pull request, #3347: URL: https://github.com/apache/pekko/pull/3347
### Motivation When the materializer running a `PartitionHub.sink` is shut down (e.g. the hosting actor stops or crashes), consumers materialized on a different materializer may not be notified of the hub's termination. This mirrors the same bug pattern found in `BroadcastHub` (see #3345). ### Modification - Move registered-consumer notification from `onUpstreamFailure` to `postStop` so that `postStop` is the single notification point for all consumers. - `postStop` now handles both `Open` (normal termination) and `Closed` (after upstream failure) states, ensuring registered consumers always receive the appropriate signal. **Before:** `onUpstreamFailure` notified registered consumers directly, but `postStop` did not. This left a gap where consumers could miss notification during materializer shutdown. **After:** `postStop` is the sole notification point for registered consumers, using the failure reason from the `Closed` state when applicable. ### Result PartitionHub consumers are reliably notified when the hub's materializer shuts down, preventing consumers from hanging indefinitely. ### Tests - `sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.HubSpec"` — 51 passed, 0 failed - Added new test: `"notify consumers when hub materializer is shut down"` (PartitionHub section) ### References Refs #3345 -- 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]
