-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Conversation
Nothing but trouble can ever come from it.
There was a problem hiding this 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.
There was a problem hiding this 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
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. |
@nodejs/ctc ... please weigh in on this! |
@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. |
Nope, not yet, but we need to get going on it. |
No traces of Also, https://github.com/search?l=JavaScript&q=NODE_TTY_UNSAFE_ASYNC&type=Code doesn't show any real uses. |
There is virtually no difference in guaranteed behaviour here, so removing the env var barely qualifies as |
given @ChALkeR's search results, I'm +1 on getting the deprecation into v7 and removing in v8. |
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. |
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? |
@addaleax Yeah, if we don't parse the flag node will exit if it is passed. :/ |
But that's not a flag. It's just an environment variable. |
Oh, of course. Whoops >_< |
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). |
I'm +1 on getting the deprecation into v7 and removing in v8. |
+1 on removing.
Agreed. |
I'd still prefer for this to go through a proper deprecation cycle but I'll switch my objection to a -0. |
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:
|
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: |
@@ -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); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 😄
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 |
There was a problem hiding this 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.)
@Fishrock123 ... how do you want to proceed on this one? Either way it needs a rebase |
picked this up @ #12057 |
Will go ahead and close this in favor of the new PR |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected 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.