Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

orchestrator: no CLI to inspect active NBD devices; lsblk shows 4096 pre-allocated noise

オープン
#3,546 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
go, linux
領域
cli, observability

調査の方向性

まず pkg/sandbox/nbd/pool.go、特に ConnectedDevices と DevicePool の構築を確認し、次に cmd/inspect-build のエントリポイントと規約を比較します。cmd/inspect-nbd が接続済みスロットをデバイス、サイズ、PID とともに報告し、-json をサポートし、提案された pool のステータスと設定された最大値の処理を含んでいれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Problem

On a sandbox node, running lsblk | grep nbd | wc -l returns 4096 — one line per pre-allocated device. All show SIZE=0B when idle, making it impossible to quickly identify which devices are actively connected to a sandbox.

# current operator experience
$ lsblk | grep nbd | wc -l
4096

# no easy way to filter to just connected ones

The 4096 devices are expected — start-client.sh loads the nbd module with nbds_max=4096 and this is persisted in /etc/modprobe.d/nbd.conf. This is correct behavior. The problem is observability: there is no tool to see which of those 4096 slots are actually in use.

What exists today

pkg/sandbox/nbd/pool.go already has the machinery:

  • ConnectedDevices() — scans /sys/block/nbdX/pid and returns only connected slots
  • DevicePool.usedSlots — a bitset of pool-tracked slots (not accessible externally)
  • OTEL metrics: orchestrator.nbd.slots_pool.acquired/released/ready — aggregate counts only

None of this is exposed via a CLI or debug endpoint. When a kernel I/O error like block nbd316: Receive control failed appears in dmesg, there is no way to correlate nbd316 to a sandbox ID.

Missing pieces

  1. No CLI tool that calls ConnectedDevices() and prints a table of active devices (slot, path, size, PID) — analogous to cmd/inspect-build
  2. No slot → sandbox ID mapping in DevicePool — even internally, usedSlots only tracks which slots are occupied, not which sandbox occupies each slot
  3. DevicePool doesn't store maxDevices — callers must re-read /sys/module/nbd/parameters/nbds_max to know the pool ceiling

Proposed fix

Add cmd/inspect-nbd: a lightweight operator tool that shows only active NBD devices.

Example output:

NBD devices: 3 connected / 4096 configured

SLOT   DEVICE      SIZE (MB)  PID
3      /dev/nbd3   1024       18234
17     /dev/nbd17  2048       18891
316    /dev/nbd316 1024       19012

Flags: -json for machine-readable output.

Secondary improvement: store maxDevices on DevicePool at construction (avoids re-reading sysfs on every call) and expose a Status() method returning used/max counts for future debug endpoints.

Slot → sandbox ID mapping is left as follow-up work.

主要言語
Go
スター
1.6k
フォーク
438
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

e2b-dev/runtime のほかの issue

e2b-dev/runtime の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。