Skip to content

Fix config reload race during NBD socket lifecycle #12

Description

@RenanGBarreto

Problem

Config reload failed while generation 1 was live because metadata preload could not connect to /run/remotepfs/nbd.sock: nbd_connect_uri: connect: No such file or directory. Full service restart restored operation, but restart is not a fix.

Expected behavior

POST /api/config/reload and compile/activate keep service lifecycle safe and either wait for the new NBD socket or fail without tearing down the active gadget generation.

Evidence

  • API service runs as root.
  • nbdkit runs as remotepfs-nbd.
  • Socket directory is 0700, socket is 0600, owned by remotepfs-nbd:remotepfs.
  • Current SBC state recovered after full service restart: NBD connected and UDC bound.

Plan

  1. Trace compile/activate ordering around nbdkit stop/start and metadata preload.
  2. Add socket readiness and ownership checks before invoking nbdsh.
  3. Preserve active generation when activation or preload fails.
  4. Add API regression coverage for reload while generation 1 is live.
  5. Verify reload, NBD connection, UDC binding, and read-only behavior on SBC.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions