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

tty: remove NODE_TTY_UNSAFE_ASYNC #10393

Closed

Conversation

Fishrock123
Copy link
Contributor

@Fishrock123 Fishrock123 commented Dec 21, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

tty

Description of change

Nothing but trouble can ever come from it.

Refs: #10157 (comment)

Edit: I should mention that anyone can still use setBlocking(false) to get this behavior back if they really desire.

Nothing but trouble can ever come from it.
@Fishrock123 Fishrock123 added semver-major PRs that contain breaking changes and should be released in the next major version. tty Issues and PRs related to the tty subsystem. labels Dec 21, 2016
@Fishrock123 Fishrock123 added this to the 8.0.0 milestone Dec 21, 2016
Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, LGTM. Not sure how much it's used, if at all.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go through a proper deprecation cycle

@Fishrock123
Copy link
Contributor Author

We should just deprecate it in v7, if anyone is actually going to yell about this I'd prefer to know now rather than in 6 months.

@jasnell
Copy link
Member

jasnell commented Dec 24, 2016

@nodejs/ctc ... please weigh in on this!

@Trott
Copy link
Member

Trott commented Dec 24, 2016

This should go through a proper deprecation cycle

@jasnell Did your deprecation policy ever land?

If we don't have a deprecation policy, let's get one.

If we have a deprecation policy, we should follow it. And if we feel like there are situations where it should be ignored, then we should change it. It shouldn't be treated as an advisory document. It should be treated as a contract with Node.js users.

@jasnell
Copy link
Member

jasnell commented Dec 24, 2016

Nope, not yet, but we need to get going on it.

@ChALkeR
Copy link
Member

ChALkeR commented Dec 25, 2016

No traces of NODE_TTY_UNSAFE_ASYNC in js/coffee/ts code from npm, as of 2016-11-24.

Also, https://github.com/search?l=JavaScript&q=NODE_TTY_UNSAFE_ASYNC&type=Code doesn't show any real uses.

@addaleax
Copy link
Member

There is virtually no difference in guaranteed behaviour here, so removing the env var barely qualifies as semver-major in my eyes.

@jasnell
Copy link
Member

jasnell commented Dec 26, 2016

given @ChALkeR's search results, I'm +1 on getting the deprecation into v7 and removing in v8.

@targos
Copy link
Member

targos commented Dec 26, 2016

I don't think usage of runtime env variables in JS files is a good metric. It's the kind of options that you will more likely find in deployment scripts or config files.

That said, I'm also +1 on removing in v8.

@Fishrock123
Copy link
Contributor Author

There is virtually no difference in guaranteed behaviour here, so removing the env var barely qualifies as semver-major in my eyes.

We could "remove" it in a minor, but it would have to be a no-op.

@addaleax
Copy link
Member

addaleax commented Jan 3, 2017

We could "remove" it in a minor, but it would have to be a no-op.

I’m not sure I understand… is there a difference between making the flag a no-op and just removing any behaviour that was behind it?

@Fishrock123
Copy link
Contributor Author

I’m not sure I understand… is there a difference between making the flag a no-op and just removing any behaviour that was behind it?

@addaleax Yeah, if we don't parse the flag node will exit if it is passed. :/

@targos
Copy link
Member

targos commented Jan 5, 2017

But that's not a flag. It's just an environment variable.

@Fishrock123
Copy link
Contributor Author

Oh, of course. Whoops >_<

@evanlucas
Copy link
Contributor

I'm +1 for removing it, I just am unsure if it should be removed in v7.x as opposed to waiting for v8.x. To be on the safe side, I think we should wait until v8.x to remove, but possibly add a runtime deprecation to it in v7.x? We definitely need a way to communicate changes that we want to make like this to the ecosystem without disruption. This one is particularly difficult due to this being something that would probably be more used in services more so than in packages (imo).

@mhdawson
Copy link
Member

I'm +1 on getting the deprecation into v7 and removing in v8.

@bnoordhuis
Copy link
Member

+1 on removing.

There is virtually no difference in guaranteed behaviour here, so removing the env var barely qualifies as semver-major in my eyes.

Agreed.

@jasnell jasnell dismissed their stale review February 1, 2017 16:45

Won't block this

@jasnell
Copy link
Member

jasnell commented Feb 1, 2017

I'd still prefer for this to go through a proper deprecation cycle but I'll switch my objection to a -0.

@misterdjules
Copy link

I would also prefer this to go through a proper deprecation cycle, so I'm -1 on this change.

As @evanlucas said better than I could:

We definitely need a way to communicate changes that we want to make like this to the ecosystem without disruption. This one is particularly difficult due to this being something that would probably be more used in services more so than in packages (imo).

@addaleax
Copy link
Member

addaleax commented Feb 7, 2017

Honestly, adding a runtime deprecation would be so much more disruptive than just dropping this feature completely…

And I’m not sure it’s clear to everyone, but just in case, I’ll expand on my comment above:
Node will attempt synchronous writes with or without the env var being present, and whether that succeeds or it has to fallback to writing asynchronously virtually always depends on external factors (e.g. performance of the terminal emulator); which means that one can’t really get reliable behaviour out of this feature anyways.

@@ -53,7 +53,7 @@ function WriteStream(fd) {
// this behaviour has become expected due historical functionality on OS X,
// even though it was originally intended to change in v1.0.2 (Libuv 1.2.1).
// Ref: https://github.com/nodejs/node/pull/1771#issuecomment-119351671
this._handle.setBlocking(process.env.NODE_TTY_UNSAFE_ASYNC !== '1');
this._handle.setBlocking(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fishrock123 Why do we do this here, for all TTY streams? Shouldn’t we just do it for process.stderr/process.stdin?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump @Fishrock123 … actually came here to comment exactly what I had written above and saw I already did that 😄

@rvagg
Copy link
Member

rvagg commented Feb 8, 2017

I agree with @addaleax' last comment, so +1 from me, however I would prefer more if we just did a proper deprecation cycle and I don't see how that could be more disruptive, we just add a check for the env var being set to '1' and use the deprecation message output and proceed as normal. That would be easy enough in 7.x and we could remove in 8.x, so an expedited deprecation cycle really.

Copy link
Member

@bnoordhuis bnoordhuis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Just reaffirming my +1 from further up so it shows in the sidebar. PR needs a rebase though.)

@jasnell
Copy link
Member

jasnell commented Mar 22, 2017

@Fishrock123 ... how do you want to proceed on this one? Either way it needs a rebase

@addaleax
Copy link
Member

picked this up @ #12057

@jasnell
Copy link
Member

jasnell commented Mar 27, 2017

Will go ahead and close this in favor of the new PR

@jasnell jasnell closed this Mar 27, 2017
@Trott Trott removed the ctc-review label Apr 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major PRs that contain breaking changes and should be released in the next major version. tty Issues and PRs related to the tty subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.