Skip to content

Asynchronous execution of sudo in parallel breaks terminal #1369

Closed
@sylv-io

Description

@sylv-io

After running an old taskfile I wrote about a year ago, I realized that there is now a bug when multiple sudo commands are run in parallel.

You can reproduce this behavior by running this Taskfile:

version: '3'

tasks:
  default:
    deps:
      - sudo
      - sudo

  sudo:
      cmds:
      - sudo true

It is important to note that the input password prompt is not necessary to brake the terminal. It works even if the password is already cached or sudo is set to nopasswd.

i could observe multiple ways it brakes the terminal, such as not rendering the terminal input, as in this asciinema recording:
asciicast

Since this behavior was not observable 1 year ago, I assumed it must be a regression in task. However, I can also reproduce this bug with older Task versions like v2.7, indicating that it could be a regression in sudo instead.

This issue was created mainly to track the progress of the investigation of this bug, and because I'm probably not the only one using sudo to do privilege stuff in task.

  • Task version: main (f0d2551)
  • Operating system: Archlinux
  • Experiments enabled: no

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