pub struct MeshAdminAgent { /* private fields */ }Expand description
Actor that serves a mesh-level admin HTTP endpoint.
MeshAdminAgent is the mesh-wide aggregation point for
introspection: it holds ActorRef<HostAgent> handles for each
host, and answers admin queries by forwarding targeted requests to
the appropriate host agent and assembling a uniform NodePayload
response for the client.
The agent also exposes an HTTP server (spawned from init) and
supports reference-based navigation (GET /v1/{reference}) by
resolving HTTP path references into typed NodePayload values
plus child references.
Implementations§
Source§impl MeshAdminAgent
impl MeshAdminAgent
Sourcepub fn new(
hosts: Vec<(String, ActorRef<HostAgent>)>,
root_client_actor_id: Option<ActorAddr>,
admin_addr: Option<SocketAddr>,
telemetry_url: Option<String>,
) -> Self
pub fn new( hosts: Vec<(String, ActorRef<HostAgent>)>, root_client_actor_id: Option<ActorAddr>, admin_addr: Option<SocketAddr>, telemetry_url: Option<String>, ) -> Self
Construct a MeshAdminAgent from a list of (host_addr, host_agent_ref) pairs and an optional root client ActorAddr.
hosts must hold each host-agent identity once, as
spawn_admin guarantees (SA-3). Hosts with different
identities may share a channel address. A host’s channel
address is read from its ActorRef; the host_addr string is
not used.
When root_client_actor_id is Some, the root client appears
as a first-class child of the root node in the introspection
tree.
The HTTP listen address is initialized to None and populated
during init() after the server socket is bound.
Trait Implementations§
impl Accepts<IntrospectMessage> for MeshAdminAgent
impl Accepts<MeshAdminMessage> for MeshAdminAgentwhere
MeshAdminMessage: RemoteMessage,
impl Accepts<ResolveReferenceMessage> for MeshAdminAgentwhere
ResolveReferenceMessage: RemoteMessage,
Source§impl Actor for MeshAdminAgent
impl Actor for MeshAdminAgent
Source§fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn init<'life0, 'life1, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Initializes the mesh admin agent and its HTTP server.
- Binds well-known handler ports (
proc.spawn_with_label()does not callbind()— unlikegspawn— so the actor must do it itself before becoming reachable). - Binds a TCP listener (ephemeral or fixed port).
- Builds a TLS acceptor and retains its selected credential
bundle (explicit env vars, then Meta default paths). At Meta
(
fbcode_build), mTLS is mandatory and init fails if no certs are found. In OSS, falls back to plain HTTP. - Creates a dedicated
Instance<()>client mailbox on system_proc for the HTTP bridge’s reply ports, keeping bridge traffic off the actor’s own mailbox. - Spawns the axum server in a background task (HTTPS with mTLS at Meta, HTTPS or HTTP in OSS depending on step 3).
- Prints one access block derived from the selected bundle.
The hostname-based listen address is stored in admin_host so
it can be returned via GetAdminAddr. The scheme (https://
or http://) is included so clients know which protocol to
use.
Source§fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
_reason: UndeliverableReason,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_undeliverable_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
_reason: UndeliverableReason,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Swallow undeliverable message bounces instead of crashing.
The admin agent sends IntrospectMessage to actors that may
not have the introspection port bound (e.g. actors spawned
via cx.spawn() whose #[export] list does not include it).
When the message cannot be delivered, the routing layer
bounces an Undeliverable back to the sender. The default
delivery-failure handling would fail the actor, which
would kill this admin agent and — via supervision cascade —
take down the entire admin process with exit(1).
Since the admin agent is best-effort infrastructure, an undeliverable introspection probe is not a fatal error.
Source§fn handle_invalid_reference<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
invalid: InvalidReference,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_invalid_reference<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Instance<Self>,
invalid: InvalidReference,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn handle_stop<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
mode: StopMode,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handle_stop<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
this: &'life1 Instance<Self>,
mode: StopMode,
reason: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn cleanup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_err: Option<&'life2 ActorError>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn cleanup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
_err: Option<&'life2 ActorError>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
fn spawn_server_task<F>(future: F) -> JoinHandle<<F as Future>::Output>
Source§fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn handle_supervision_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
_this: &'life1 Instance<Self>,
event: &'life2 ActorSupervisionEvent,
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Source§fn handle_delivery_failure_event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_delivery_failure_event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn handle_expired_delivery<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
expired: ExpiredDelivery,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn handle_expired_delivery<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Instance<Self>,
expired: ExpiredDelivery,
undeliverable: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Source§fn display_name(&self) -> Option<String>
fn display_name(&self) -> Option<String>
Source§impl Binds<MeshAdminAgent> for MeshAdminAgent
impl Binds<MeshAdminAgent> for MeshAdminAgent
Source§fn bind(ports: &HandlerPorts<Self>)
fn bind(ports: &HandlerPorts<Self>)
Source§impl Debug for MeshAdminAgent
impl Debug for MeshAdminAgent
Source§impl Handler<MeshAdminMessage> for MeshAdminAgent
Manual Handler impl — swallows reply.send() failures so the
admin agent stays alive when the HTTP caller disconnects.
impl Handler<MeshAdminMessage> for MeshAdminAgent
Manual Handler impl — swallows reply.send() failures so the
admin agent stays alive when the HTTP caller disconnects.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
msg: MeshAdminMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
msg: MeshAdminMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dispatches MeshAdminMessage variants.
Reply-send failures are swallowed because a dropped receiver (e.g. the HTTP bridge timed out) is not an error — the caller simply went away. Propagating the failure would crash the admin agent and take down the entire process.
Source§fn message_status_reporting() -> MessageStatusReporting
fn message_status_reporting() -> MessageStatusReporting
Source§impl Handler<ResolveReferenceMessage> for MeshAdminAgent
Manual Handler impl — swallows reply.send() failures so the
admin agent stays alive when the HTTP caller disconnects.
impl Handler<ResolveReferenceMessage> for MeshAdminAgent
Manual Handler impl — swallows reply.send() failures so the
admin agent stays alive when the HTTP caller disconnects.
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
msg: ResolveReferenceMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, Self>,
msg: ResolveReferenceMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dispatches ResolveReferenceMessage variants.
The inner resolve_reference call never returns Err to the
handler — failures are captured in the response payload.
Reply-send failures are swallowed for the same reason as
MeshAdminMessage: a dropped receiver means the caller (HTTP
bridge) went away, which must not crash the admin agent.
Source§fn message_status_reporting() -> MessageStatusReporting
fn message_status_reporting() -> MessageStatusReporting
Source§impl Named for MeshAdminAgent
impl Named for MeshAdminAgent
Source§fn typename() -> &'static str
fn typename() -> &'static str
Source§fn typehash() -> u64
fn typehash() -> u64
Source§fn typeid() -> TypeId
fn typeid() -> TypeId
impl Referable for MeshAdminAgent
impl RemoteHandles<IntrospectMessage> for MeshAdminAgent
impl RemoteHandles<MeshAdminMessage> for MeshAdminAgentwhere
MeshAdminMessage: RemoteMessage,
impl RemoteHandles<ResolveReferenceMessage> for MeshAdminAgentwhere
ResolveReferenceMessage: RemoteMessage,
Auto Trait Implementations§
impl Freeze for MeshAdminAgent
impl RefUnwindSafe for MeshAdminAgent
impl Send for MeshAdminAgent
impl Sync for MeshAdminAgent
impl Unpin for MeshAdminAgent
impl UnsafeUnpin for MeshAdminAgent
impl UnwindSafe for MeshAdminAgent
Blanket Implementations§
impl<T> Allocation for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A> Handler<IntrospectMessage> for Awhere
A: Actor,
impl<A> Handler<IntrospectMessage> for Awhere
A: Actor,
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, A>,
_message: IntrospectMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_cx: &'life1 Context<'_, A>,
_message: IntrospectMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
Source§fn message_status_reporting() -> MessageStatusReporting
fn message_status_reporting() -> MessageStatusReporting
Source§impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
impl<A> Handler<Undeliverable<MessageEnvelope>> for Awhere
A: Actor,
Source§fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
fn handle<'life0, 'life1, 'async_trait>(
&'life0 mut self,
cx: &'life1 Context<'_, A>,
message: Undeliverable<MessageEnvelope>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
A: 'async_trait,
Source§fn message_status_reporting() -> MessageStatusReporting
fn message_status_reporting() -> MessageStatusReporting
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].