Skip to content

ckb miner can be orphaned and keep running after the node/offckb exits #512

Description

@RetricSu

What happened

After stopping a local offckb node, ckb miner processes can survive as orphans (PPID=1) and keep running indefinitely.

Observed on macOS with @offckb/cli / CKB 0.204.0:

ckb miner -C ~/Library/Application Support/offckb-nodejs/devnet

Two leftover miners were still running ~32 days later. The node was gone (127.0.0.1:8114 not listening). Each miner was polling RPC every 1s (ckb-miner.toml poll_interval = 1000) against a dead endpoint, with no TCP connection, Dummy worker, and a small but constant CPU cost (~0.1–1.3% each).

stdout/stderr of the orphans pointed at dead unix sockets, so they no longer wrote useful logs. Later offckb start/stop cycles (including a clean ctrl-c that did stop that session’s miner) did not reap the old processes.

Expected

Stopping the node / exiting offckb should also stop the miners it started. A later offckb start should not leave extra miners from previous runs.

Actual

Miner processes can outlive the parent, get adopted by launchd (PPID=1), and sit there until killed by hand.

Notes

Not a LaunchAgent; they do not come back after a reboot. Killing them with SIGTERM worked. Local chain data was left untouched.

Happy to provide more process/log details if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions