Skip to content

apply_configs can hang forever in cli_progress at ~94% CPU with no child processes — configs are already applied, wrapper never exits #5551

Description

@eveiljuice

Describe the bug

apply_configs (CLI, over SSH) sometimes never returns. The
python -m cli_progress wrapper process spins at ~90–95% CPU with no child
processes
under it. All configs are in fact already applied — the hang is
purely in the progress-display layer. Killing the wrapper is safe.

Root cause pointer

common/utils.sh (~line 446) wraps the whole installer:

python -m cli_progress --title "Hiddify Manager" "$@"

Observed on 12.3.3 / Ubuntu 24.04: the wrapper busy-loops with no children for
tens of minutes after the underlying work is done. I have not traced it further
into cli_progress internals — reporting as observed. Possibly related to
terminal-state detection when there is no interactive TTY (no usable $TERM /
terminal width over a plain SSH exec), but that is a hypothesis, not a verified
cause.

The practical damage: users see a stuck "applying" screen, conclude the apply
failed, and start a second apply concurrently (see also the lock-related
behavior in install.sh) or abandon the box mid-way — while the config is
actually fine.

To Reproduce

Not yet deterministic on demand; happened repeatedly on this setup during
DNSTT-related applies over SSH (ssh host /opt/hiddify-manager/apply_configs.sh).

  1. Run apply_configs from a non-interactive SSH session.
  2. Occasionally: wrapper stays alive forever at ~94% CPU, ps --ppid <pid>
    shows nothing.
  3. Configs and services are in their target state.

Expected behavior

The progress wrapper must exit when the wrapped pipeline is done, and must
never busy-loop without children.

Environment

  • Hiddify Manager: 12.3.3
  • OS: Ubuntu 24.04, kernel 6.8
  • Invocation: apply_configs over SSH, non-interactive

Suggested directions

  • Fall back to plain passthrough logging when no interactive TTY is detected.
  • Add a watchdog inside the wrapper (exit when the child pipeline is gone).
  • On pipeline completion, flush and exit instead of continuing to animate.

Workaround for users

timeout 600 /opt/hiddify-manager/apply_configs.sh

then verify by inspecting services/configs rather than trusting the progress
bar. A hung wrapper can be killed safely — the install itself has already
completed.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions