Skip to content

Renaming main thread causes issues with UNIX utilities #17036

@laanwj

Description

@laanwj

Renaming the main thread (e.g., the one the program spawns with) causes the name of the daemon in utilities such as "top" to show as "b-init" instead of bitcoind. This is surprising, as it doesn't show the other thread names (by default), you'd expect it to show program names.

This doesn't only affect top: killall does no longer recognize the program name

$ killall bitcoind
bitcoind: no process found
$ killall b-init
(no output, succesful)

In contrast to bitcoin-qt, which doesn't suffer from this problem because it has a separate init thread, initialization happens in the main thread in bitcoind, and it's renamed due to util::ThreadRename("init"); in AppInit. If we want to name the init thread, this should only be done in bitcoin-qt.

(not sure when this was introduced, but #16984 made the issue more visible because ther's no bitcoin in the name anymore)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions