Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console race condition when spawn sudo output without async iterator #27926

Open
loynoir opened this issue Feb 1, 2025 · 0 comments
Open

console race condition when spawn sudo output without async iterator #27926

loynoir opened this issue Feb 1, 2025 · 0 comments

Comments

@loynoir
Copy link

loynoir commented Feb 1, 2025

Version: Deno x.x.x

deno 2.1.6 (stable, release, x86_64-unknown-linux-gnu)
v8 13.0.245.12-rusty
typescript 5.6.2

Related

summary

Until now, have not yet been confirmed as bug by nodejs and yarn.

Below is summary based on my current understanding of this problem.

I think

  • This is a nodejs + deno race condition bug when sudo

  • This may called yarn berry bug, depends on individual preference.

brief

https://github.com/loynoir/reproduce-yarn-berry-6667

  "scripts": {
    "reproduce": "yarn workspaces foreach --all --exclude . run reproduce",
    "workaround": "yarn workspaces foreach --all --exclude . run workaround",
    "simulate": "yarn workspaces foreach --all --exclude . run simulate"
  }
  "scripts": {
    "reproduce": "sudo node ./simulate.mjs",
    "workaround": "deno run -A ./workaround.ts",
    "simulate": "node ./simulate.mjs"
  }
script console
yarn reproduce mess up
yarn workaround OK
yarn simulate Ok
DISABLE_WORKAROUND=1 yarn workaround mess up

node

Because

  • yarn simulate console OK

Which means

  • yarn berry logic is fine.

But

  • yarn reproduce console mess up.

  • yarn workaround console OK

Which means

  • There is a way, I have not yet have time to extract logic out from yarn berry, leads to sudo XXX console is not isomprphic to XXX console.

  • There is also a way, let sudo XXX console isomprphic to XXX console

  • sudo XXX console is not always isomprphic to XXX console

I think

  • This is a nodejs race condition bug when sudo.

yarn

Because

  • yarn reproduce console mess up.

  • yarn workaround console OK

  • yarn simulate console OK

I think

  • This may called yarn berry bug, depends on individual preference.

deno

Because

  • yarn workaround console OK

  • DISABLE_WORKAROUND=1 yarn workaround console mess up

I think

  • This is a deno race condition bug when sudo without async iterator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant