[PR #25] [CLOSED] fix(ublk): stop blocking tokio workers while waiting for ublk device nodes #123

Closed
opened 2026-10-29 14:19:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/25
Author: @hemildesai
Created: 7/28/2026
Status: ❌ Closed

Base: main ← Head: fix/ublk-async-device-wait


📝 Commits (1)

  • 3ed4b53 fix(ublk): stop blocking tokio workers while waiting for ublk device nodes

📊 Changes

3 files changed (+85 additions, -27 deletions)

View changed files

📝 storage/ublk-daemon/src/main.rs (+10 -1)
📝 storage/ublk-daemon/src/server.rs (+14 -5)
📝 storage/ublk/src/lib.rs (+61 -21)

📄 Description

Problem

wait_for_ublk_dev sleeps with std::thread::sleep and is called from the ublk daemon's async device-creation paths without .await, parking a tokio worker for the whole wait:

// storage/ublk-daemon/src/server.rs (3 call sites)
if let Err(err) = wait_for_ublk_dev(dev_id).context("wait for ublk device") { ... }

The daemon runs a hardcoded 4-worker runtime (worker_threads(4)), so concurrent cold device creations are capped at 4, each holding its worker for at least the 10 ms first retry interval.

Note

This PR was opened in error against a repository we do not own, and has been closed. Retained only for the discussion thread.

Per review feedback, the correct fix is to remove the wait entirely rather than make it async: after add_dev/start_dev return, ublk_ctrl_start_dev -> device_add_disk -> device_add has already created the device node, so there is nothing to wait for.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/25 **Author:** [@hemildesai](https://github.com/hemildesai) **Created:** 7/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/ublk-async-device-wait` --- ### 📝 Commits (1) - [`3ed4b53`](https://github.com/kvcache-ai/AgentENV/commit/3ed4b53dae13b6d646f40d07dc2cdafee07474d5) fix(ublk): stop blocking tokio workers while waiting for ublk device nodes ### 📊 Changes **3 files changed** (+85 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `storage/ublk-daemon/src/main.rs` (+10 -1) 📝 `storage/ublk-daemon/src/server.rs` (+14 -5) 📝 `storage/ublk/src/lib.rs` (+61 -21) </details> ### 📄 Description ## Problem `wait_for_ublk_dev` sleeps with `std::thread::sleep` and is called from the ublk daemon's async device-creation paths **without `.await`**, parking a tokio worker for the whole wait: ```rust // storage/ublk-daemon/src/server.rs (3 call sites) if let Err(err) = wait_for_ublk_dev(dev_id).context("wait for ublk device") { ... } ``` The daemon runs a hardcoded 4-worker runtime (`worker_threads(4)`), so concurrent cold device creations are capped at 4, each holding its worker for at least the 10 ms first retry interval. ## Note This PR was opened in error against a repository we do not own, and has been closed. Retained only for the discussion thread. Per review feedback, the correct fix is to remove the wait entirely rather than make it async: after `add_dev`/`start_dev` return, `ublk_ctrl_start_dev -> device_add_disk -> device_add` has already created the device node, so there is nothing to wait for. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:19:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#123
No description provided.