Skip to content

Conversation

cgwalters
Copy link
Collaborator

I'm doing some tracing with bpftrace and it shows comm as tokio-runtime-w. This ensures it shows bootc as one would expect.

I'm doing some tracing with `bpftrace` and it shows `comm` as
`tokio-runtime-w`. This ensures it shows `bootc` as one would
expect.

Signed-off-by: Colin Walters <[email protected]>
@bootc-actions-token bootc-actions-token bot requested a review from ckyrouac August 21, 2025 11:01
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to set the Tokio thread name for better traceability. While the code change itself is correct for setting the thread name prefix for Tokio's blocking thread pool, there seems to be a discrepancy with the problem description. The change will affect threads named tokio-blocking-N, but the description mentions tokio-runtime-w, which corresponds to worker threads of a multi-threaded runtime. The current implementation uses a single-threaded runtime, which does not have worker threads. I've added a comment to clarify this point, as the change might not solve the issue you're observing.

@@ -28,6 +28,7 @@ fn run() -> Result<()> {
// tokio::task::spawn_blocking to create a new OS thread explicitly.
let runtime = tokio::runtime::Builder::new_current_thread()
.enable_all()
.thread_name("bootc")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change sets the name for threads in the blocking pool, which are named tokio-blocking-N by default. Your PR description mentions you are seeing tokio-runtime-w, which is the default name for worker threads in a multi-threaded Tokio runtime.

The runtime here is created with new_current_thread(), which does not have worker threads, only a blocking pool. This change will rename threads from tokio-blocking-N to bootc-N, but it will not affect any threads named tokio-runtime-w.

Could you please double-check the thread name you are seeing? If it is indeed tokio-runtime-w, then those threads are likely being created by a different Tokio runtime, and this change will not affect them.

@cgwalters cgwalters marked this pull request as draft August 21, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant