feat(app-server): propagate traces across tasks and core ops#14387
feat(app-server): propagate traces across tasks and core ops#14387
Conversation
273b27c to
4a2ec69
Compare
|
@codex review |
4a2ec69 to
a4f17b4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4f17b4cec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
a4f17b4 to
cdeed13
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cdeed13284
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
533026b to
21448b6
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89fb20e99d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ed02aec2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| self.background_tasks.close(); | ||
| if tokio::time::timeout(Duration::from_secs(10), self.background_tasks.wait()) | ||
| .await | ||
| .is_err() | ||
| { | ||
| warn!("timed out waiting for background tasks to shut down; proceeding"); | ||
| } |
There was a problem hiding this comment.
Cancel timed-out background tasks before thread shutdown
drain_background_tasks only waits 10s, then logs and returns without aborting unfinished tasks. Shutdown then proceeds to shutdown_threads, which snapshots current threads. A still-running thread_start_task can create a new thread after that snapshot, leaving it alive past shutdown (resource leak / orphaned work).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
valid but not worth the complexity atm
7ed02ae to
7871cf0
Compare
7871cf0 to
07964b8
Compare
Summary
This PR keeps app-server RPC request trace context alive for the full lifetime of the work that request kicks off (e.g. for
thread/start, this isapp-server rpc handler -> tokio background task -> core op submissions). Previously we lose trace lineage once the request handler returns or hands work off to background tasks.This approach is especially relevant for
thread/startand other RPC handlers that run in a non-blocking way. In the near future we'll most likely want to make all app-server handlers run in a non-blocking way by default, and only queue operations that must operate in order (e.g. thread RPCs per thread?), so we want to make sure tracing in app-server just generally works.Depends on #14300
Before

After

What changed
thread/startwork so background startup stays attached to the originating request.thread/startturn/start