Skip to content

Commit

Permalink
chore: add runner socket observability (#1546)
Browse files Browse the repository at this point in the history
<!-- Please make sure there is an issue that this PR is correlated to. -->
Fixes RVT-4328
## Changes

<!-- If there are frontend changes, please include screenshots. -->
  • Loading branch information
MasterPtato committed Dec 9, 2024
1 parent 2dff9e5 commit 38e2003
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/infra/client/manager/src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ impl Ctx {
Ok((stream, _)) => {
let mut socket = tokio_tungstenite::accept_async(stream).await?;

tracing::info!("received new socket");

if let Some(runner) = &*self2.isolate_runner.read().await {
runner.attach_socket(socket).await?;
} else {
Expand Down Expand Up @@ -609,7 +611,7 @@ impl Ctx {
if let Some(isolate_runner_pid) = isolate_runner_pid {
let mut guard = self.isolate_runner.write().await;

tracing::info!(?isolate_runner_pid, "found old isolate runner");
tracing::info!(?isolate_runner_pid, "found existing isolate runner");

let runner = runner::Handle::from_pid(
runner::Comms::socket(),
Expand Down
4 changes: 4 additions & 0 deletions packages/infra/client/manager/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ impl Handle {
match &self.comms {
Comms::Basic => bail!("attempt to attach socket to basic runner"),
Comms::Socket(tx) => {
tracing::info!(pid=?self.pid, "attaching socket");

let mut guard = tx.lock().await;

if guard.is_some() {
Expand Down Expand Up @@ -103,6 +105,8 @@ impl Handle {
}
}
});

tracing::info!(pid=?self.pid, "socket attached");
}
}

Expand Down

0 comments on commit 38e2003

Please sign in to comment.