Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Release channels have their own copy of this changelog:
<a name="edge-channel"></a>
## 3.0.0 - Unreleased

### RPC

#### Changes
* The subscription server now prioritizes processing received messages before sending out responses. This ensures that new subscription requests and time-sensitive messages like `PING` opcodes take priority over notifications.

### Validator

#### Breaking
Expand Down
6 changes: 6 additions & 0 deletions rpc/src/rpc_pubsub_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ async fn handle_connection(
pin!(receive_future);
loop {
select! {
biased; // See [prioritization] note below.

// [prioritization]
// This block must come FIRST in the `select!` macro. This prioritizes
// processing received messages over sending messages. This ensures the timely
// processing of new subscriptions and time-sensitive opcodes like `PING`.
result = &mut receive_future => match result {
Ok(_) => break,
Err(soketto::connection::Error::Closed) => return Ok(()),
Expand Down
Loading