From 6456ee7836fb30489cc6b4f84d1b4fa6857305b3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 23 Nov 2026 10:39:21 +0000 Subject: [PATCH 1/4] Remove the template comments from the release notes The Upgrading, New Features and Bug Fixes sections have entries, so their template comments are not needed anymore. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e19c87d6..c16d91c2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,8 +6,6 @@ ## Upgrading - - - `BroadcastChannel()` and `BroadcastSender.subscribe()` now take everything but the name by keyword: `resend_latest`, `buffer_size` and `warn_on_overflow`. A call that passed any of them by position fails with a `TypeError`. Pass them by keyword, as v1.13.0 recommends. - The deprecated `limit` argument of `BroadcastChannel()` and `BroadcastSender.subscribe()` is removed. Use `buffer_size` instead, which exists since v1.13.0, so you can migrate before upgrading. `Broadcast.new_receiver()` still takes `limit`. @@ -50,8 +48,6 @@ ## New Features - - - `TransientSenderError` is a new `SenderError` for errors after which the sender and its channel can still be used: only the message that failed wasn't sent. Catch it before `SenderError` to tell it apart from the errors that make a sender unusable. - `SenderHasNoReceiversError` is a new `TransientSenderError`. An open sender of a `BroadcastChannel`, or of a `Broadcast` created with `auto_close=True`, raises it from `send()` while the channel is open but has no receivers. The message is dropped, but with `resend_latest=True`, new receivers still get it if it is the last message sent and it isn't `None`. The channel stays open, so sending works again once a receiver subscribes. @@ -62,8 +58,6 @@ ## Bug Fixes - - - Closing a broadcast receiver now wakes up tasks waiting for messages on it, instead of leaving them blocked until the next message arrived or the channel was closed. - Closing a broadcast receiver now drops the messages left in its buffer, so it is no longer reported as ready. So `select()` no longer reports it as stopped over and over, and no longer fails with a `SelectError` for a `filter()` on it. From 86f4523e246abf66da336b56bf9bcc61741a26ee Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 23 Nov 2026 10:39:27 +0000 Subject: [PATCH 2/4] Say which arguments are keyword-only in each function The release notes listed `resend_latest` among the keyword-only arguments of both `BroadcastChannel()` and `BroadcastSender.subscribe()`, but `subscribe()` doesn't take it. They also said v1.13.0 recommends passing these arguments by keyword, which read as if v1.13.0 warned about all of them. It only deprecates passing `warn_on_overflow` by position; a positional `resend_latest` works without a warning in v1.13.0, so tell users to look for it. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c16d91c2..4545a761 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,7 +6,7 @@ ## Upgrading -- `BroadcastChannel()` and `BroadcastSender.subscribe()` now take everything but the name by keyword: `resend_latest`, `buffer_size` and `warn_on_overflow`. A call that passed any of them by position fails with a `TypeError`. Pass them by keyword, as v1.13.0 recommends. +- `BroadcastChannel()` and `BroadcastSender.subscribe()` now take only the name by position. `resend_latest` (only in `BroadcastChannel()`), `buffer_size` and `warn_on_overflow` must be passed by keyword. A call that passes any of them by position fails with a `TypeError`. v1.13.0 already deprecates passing `warn_on_overflow` by position, but it doesn't warn about `resend_latest`, so look for calls like `BroadcastChannel("name", True)` and pass it by keyword. - The deprecated `limit` argument of `BroadcastChannel()` and `BroadcastSender.subscribe()` is removed. Use `buffer_size` instead, which exists since v1.13.0, so you can migrate before upgrading. `Broadcast.new_receiver()` still takes `limit`. From 75e0d585be9c3c7d4f51c8c9587e60f6f1adb339 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 23 Nov 2026 10:39:37 +0000 Subject: [PATCH 3/4] Add the summary of the release notes v2.0.0 is not only a cleanup release: besides removing what v1.13.0 deprecated, it changes how `BroadcastChannel` behaves in ways v1.13.0 can't warn about, and adds a `Pipe` that closes its ends where the experimental one doesn't. List those changes in the summary, so users see them before upgrading, and explain how to upgrade through v1.13.0. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4545a761..e8f45be8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,7 +2,15 @@ ## Summary - +This release removes what v1.13.0 deprecated, and it has breaking changes that v1.13.0 can't warn about, mostly in `BroadcastChannel`. Read the Upgrading section before upgrading. The main breaking changes are: + +- A `BroadcastChannel` no longer closes when a message is sent while it has no receivers. `send()` raises the new `SenderHasNoReceiversError` instead, and the channel stays open, so code that relied on the channel closing has to catch the error. +- `BroadcastChannel()` takes `resend_latest` only by keyword, `BroadcastSender.subscribe()` uses the channel's `buffer_size` and `warn_on_overflow` as defaults, and `BroadcastSender.clone()` raises a `SenderClosedError` on a closed sender. +- `Receiver.close()` is abstract, so custom receivers have to implement it. + +The new `frequenz.channels.Pipe` is a separate implementation that replaces `frequenz.channels.experimental.Pipe`, which is deprecated but still behaves as in v1. The new `Pipe` closes its sender, and by default its receiver too, in cases where the experimental one leaves them open, so check how your code shuts down before switching. + +To upgrade, move to v1.13.0 first and fix all its deprecation warnings: every replacement already exists there, so a project can then require `frequenz-channels >= 1.13.0, < 3`. Then check the changes above, which can make the same code behave differently on v2. `Broadcast` still works, but stays deprecated. ## Upgrading From d7fede0b62fdac505de53c4f6c8b6002766c7e91 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 23 Nov 2026 11:52:34 +0000 Subject: [PATCH 4/4] Say when cloning a sender can find its channel closed The entry about `BroadcastSender.clone()` said it raises a `SenderError` if the channel is closed, which suggests it can happen with any open sender. A `BroadcastChannel` only closes when all its senders are closed, so an open sender always has an open channel. Only a `Broadcast` can be closed with `aclose()` while it has open senders, so say that case is specific to it. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e8f45be8..e68943c2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -46,7 +46,7 @@ To upgrade, move to v1.13.0 first and fix all its deprecation warnings: every re - With `close_pipe_on_send_error=False`, the new `Pipe` also drops the message that failed with any other `SenderError` and keeps forwarding the next ones. This doesn't bring back the behavior of the experimental one. - `stop()` leaves both ends open in both. -- `BroadcastSender.clone()` now raises a `SenderClosedError` if the sender is closed, and a `SenderError` if the channel is closed, like `send()` and `subscribe()` do. Clone a sender before closing it, or catch `SenderError`. +- `BroadcastSender.clone()` now raises a `SenderClosedError` if the sender is closed, like `send()` and `subscribe()` do. Clone a sender before closing it, or catch `SenderClosedError`. A `Broadcast` can also be closed with `aclose()` while it still has open senders; after that, cloning any of them raises a `SenderError`. - `BroadcastSender.subscribe()` now uses the `buffer_size` and `warn_on_overflow` values the `BroadcastChannel` was created with as defaults, instead of `50` and `True`. Pass `buffer_size=50, warn_on_overflow=True` to keep the old values.