Skip to content

Commit 35c4512

Browse files
shayne-fletchermeta-codesync[bot]
authored andcommitted
v1/logging: avoid spinning up LogForwardActor mesh when redundant (#1722)
Summary: Pull Request resolved: #1722 Differential Revision: D85919326
1 parent 0686f72 commit 35c4512

File tree

4 files changed

+340
-16
lines changed

4 files changed

+340
-16
lines changed

hyperactor_mesh/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@ hyperactor_mesh_macros = { version = "0.0.0", path = "../hyperactor_mesh_macros"
6363
hyperactor_telemetry = { version = "0.0.0", path = "../hyperactor_telemetry" }
6464
libc = "0.2.139"
6565
mockall = "0.13.1"
66+
monarch_hyperactor = { version = "0.0.0", path = "../monarch_hyperactor" }
6667
ndslice = { version = "0.0.0", path = "../ndslice" }
6768
nix = { version = "0.30.1", features = ["dir", "event", "hostname", "inotify", "ioctl", "mman", "mount", "net", "poll", "ptrace", "reboot", "resource", "sched", "signal", "term", "time", "user", "zerocopy"] }
6869
opentelemetry = "0.29"
6970
pin-project = "1.1.10"
7071
preempt_rwlock = { version = "0.0.0", path = "../preempt_rwlock" }
72+
pyo3 = { version = "0.24", features = ["anyhow", "multiple-pymethods", "py-clone"] }
7173
rand = { version = "0.8", features = ["small_rng"] }
7274
serde = { version = "1.0.219", features = ["derive", "rc"] }
7375
serde_bytes = "0.11"

hyperactor_mesh/test/bootstrap.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
// Make sure this binary pulls in monarch_hyperactor's attr registry
10+
// (inventory::submit! side effects). With LTO / linker GC, just
11+
// adding the crate as a dep is not enough: if nothing in this binary
12+
// references it, the linker will drop it and its AttrKeyInfo
13+
// submissions will never register. Touching a symbol makes the linker
14+
// keep the crate. Issue
15+
// https://github.com/dtolnay/inventory/issues/7 says this shouldn't
16+
// be necessary (see also D71096199).
17+
#[allow(dead_code)]
18+
fn _link_monarch_hyperactor_attrs() {
19+
let _ = monarch_hyperactor::pytokio::UNAWAITED_PYTOKIO_TRACEBACK.name();
20+
}
21+
922
/// This is an "empty shell" bootstrap process,
1023
/// simply invoking [`hyperactor_mesh::bootstrap_or_die`].
1124
#[tokio::main]
@@ -20,5 +33,9 @@ async fn main() {
2033
libc::signal(libc::SIGTERM, libc::SIG_DFL);
2134
}
2235

36+
// For Procs with embededded python. Safe to call even if it is
37+
// never actually used.
38+
pyo3::prepare_freethreaded_python();
39+
2340
hyperactor_mesh::bootstrap_or_die().await;
2441
}

monarch_hyperactor/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ tokio-util = { version = "0.7.15", features = ["full"] }
5252
tracing = { version = "0.1.41", features = ["attributes", "valuable"] }
5353

5454
[dev-dependencies]
55+
buck-resources = "1"
5556
dir-diff = "0.3"
5657

5758
[features]

0 commit comments

Comments
 (0)