Skip to content

Commit 80b2dc4

Browse files
pzhan9facebook-github-bot
authored andcommitted
Add re-ordering buffer to the actor side
Summary: In Rust V1, we want to move the re-ordering buffer from [comm actor](https://www.internalfb.com/code/fbsource/[aea72188b23ef1539c1a04996566a8f188e42644]/fbcode/monarch/hyperactor_mesh/src/comm.rs?lines=383-384) to the actor side. The basic idea is: * client assigns the seq no for messages it sends to actors; * the `(client_name, seq_no)` tuple is added to the message's header. * for direct send, client will add that header; * for multicast, a actor->seq map is passed to comm actors, and comm actor will add that header before delivering the message to actors. * Each actor instance maintains its own re-ordering buffer, and use the `seq_no` to buffer and re-order the message, before passing the message to the actor loop. This diff implements the last part, the re-ordering buffer in actor instance. Specifically, this diff wrap the re-ordering buffer under the `OrderChannel` abstraction, so it can fit to the current implementation seamlessly. The change is currently disabled behind the `ENABLE_CLIENT_SEQ_ASSIGNMENT` gate. Differential Revision: D82573932
1 parent 692e1d6 commit 80b2dc4

File tree

2 files changed

+325
-4
lines changed

2 files changed

+325
-4
lines changed

hyperactor/src/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ declare_attrs! {
6262

6363
/// How often to check for full MSPC channel on NetRx.
6464
pub attr CHANNEL_NET_RX_BUFFER_FULL_CHECK_INTERVAL: Duration = Duration::from_secs(5);
65+
66+
/// Whether to enable client sequence assignment.
67+
pub attr ENABLE_CLIENT_SEQ_ASSIGNMENT: bool = false;
6568
}
6669

6770
/// Load configuration from environment variables

0 commit comments

Comments
 (0)