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

process: provide dummy stdio for non-console Windows apps #20640

Closed
wants to merge 2 commits into from

Conversation

@addaleax
Copy link
Member

commented May 9, 2018

The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which uv_guess_handle fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@addaleax addaleax requested a review from gireeshpunathil May 9, 2018

@addaleax addaleax added windows and removed errors labels May 9, 2018

@mscdex

This comment has been minimized.

Copy link
Contributor

commented May 9, 2018

s/knonw/known/ in commit message

@jasnell jasnell requested review from bnoordhuis and Fishrock123 May 9, 2018

@jasnell
jasnell approved these changes May 9, 2018
@Fishrock123
Copy link
Member

left a comment

otherwise lgtm

@gireeshpunathil

This comment has been minimized.

Copy link
Member

commented May 10, 2018

@addaleax - you took the approach of covering all the uv_guess_handle failure cases under windows console scenario right? I guess there were real erroneous scenarios (i.e., running under windows powershell) that led to uv_guess_handle failure through race conditions. We never bothered to debug them as we haven't made a support statement around powershell. I am unable to find references, @bnoordhuis or @refack may know better on this.

Given the possibility of behavioral change (standard stream data absorbed / unavailable) will this be a semver major?

@bnoordhuis
Copy link
Member

left a comment

Code changes LGTM. On the fence as to whether it's a good idea to unconditionally suppress all errors.

doc/api/errors.md Show resolved Hide resolved
@addaleax

This comment has been minimized.

Copy link
Member Author

commented May 10, 2018

I guess there were real erroneous scenarios (i.e., running under windows powershell) that led to uv_guess_handle failure through race conditions. We never bothered to debug them as we haven't made a support statement around powershell.

Sorry, I didn’t know of that. What I tried to express in the commit message is that even in those cases, things don’t work like they should and we’d probably still get a bug report. The flipside here is that I don’t know how else to address this if we do want non-throwing behaviour for stdio in Windows apps (which I think we want).

Given the possibility of behavioral change (standard stream data absorbed / unavailable) will this be a semver major?

I don’t really see this as a “something that worked before doesn’t work anymore” kind of thing, but I can also understand if people want to be careful. For now, I’ll just add dont-land labels for LTS.

@lpinca
lpinca approved these changes May 10, 2018
const { Readable } = require('stream');
stdin = new Readable({ read() {} });
stdin.push(null);
break;

This comment has been minimized.

Copy link
@lpinca

lpinca May 10, 2018

Member

Nit: can we remove this break and the one below?

This comment has been minimized.

Copy link
@addaleax

addaleax May 13, 2018

Author Member

@lpinca done!

@addaleax addaleax force-pushed the addaleax:dummy-stdio branch from 4df7637 to f49144c May 13, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented May 13, 2018

@gireeshpunathil Are you okay with this?

Also, yes, I would like to go with semver-patch for this one, unless anybody has strong feelings about it.

CI: https://ci.nodejs.org/job/node-test-commit/18456/

@gireeshpunathil

This comment has been minimized.

Copy link
Member

commented May 14, 2018

Unfortunately I am unable to make up myself with the mapping of uv_guess_handle failure with a win-32 non-console embedding scenario. At the same time I don't have a suggestion to offer too!

So I am neither approving nor blocking.

@addaleax

This comment has been minimized.

@jasnell

This comment has been minimized.

Copy link
Member

commented May 23, 2018

Fresh CI run since the previous run results are no longer available: https://ci.nodejs.org/job/node-test-pull-request/15063/

@BridgeAR BridgeAR added author ready and removed author ready labels May 29, 2018

@BridgeAR

This comment has been minimized.

Copy link
Member

commented May 30, 2018

Seems like there are related test failures.

@jasnell

This comment has been minimized.

Copy link
Member

commented Sep 10, 2018

Ping @addaleax

@jasnell jasnell added the stalled label Sep 10, 2018

@addaleax addaleax force-pushed the addaleax:dummy-stdio branch 2 times, most recently from fc2a431 to 13904dc Oct 13, 2018

@addaleax

This comment has been minimized.

Copy link
Member Author

commented Oct 13, 2018

@Trott

This comment has been minimized.

Copy link
Member

commented Dec 4, 2018

Landed in ab6c09b

@Trott Trott closed this Dec 4, 2018

Trott added a commit to Trott/io.js that referenced this pull request Dec 4, 2018
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: nodejs#20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
BridgeAR added a commit that referenced this pull request Dec 5, 2018
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: #20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
BridgeAR added a commit that referenced this pull request Dec 5, 2018
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: #20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BridgeAR BridgeAR referenced this pull request Dec 5, 2018
4 of 4 tasks complete
@BridgeAR

This comment has been minimized.

Copy link
Member

commented Dec 7, 2018

This test is failing in the 11.4.0 release proposal in the same way as it did here before.

@addaleax I am uncertain what is best to pull out: this test, the libuv update or both. Do you have a suggestion?

@BridgeAR

This comment has been minimized.

Copy link
Member

commented Dec 7, 2018

@targos and me decided to pull this one out instead of the libuv update. I added the backport-requested label accordingly.

@BridgeAR BridgeAR referenced this pull request Dec 7, 2018
2 of 2 tasks complete
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Dec 7, 2018

@BridgeAR Do you know why the libuv update + this PR in combination don’t fail on master?

Also, I am not optimistic about being able to backport this without engagement from somebody on macOS.

@addaleax addaleax deleted the addaleax:dummy-stdio branch Dec 7, 2018

@BridgeAR

This comment has been minimized.

Copy link
Member

commented Dec 7, 2018

@addaleax no, sorry. I have no idea why it works on master. But on 11 it failed on two CIs in a row.

@nodejs/platform-macos PTAL

@targos targos added this to Backport requested in v11.x Dec 7, 2018

addaleax added a commit to addaleax/node that referenced this pull request Jan 5, 2019
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: nodejs#20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@addaleax

This comment has been minimized.

Copy link
Member Author

commented Jan 5, 2019

Opened a backport PR at #25356, let’s see if it still fails (and if so, try to figure out why).

BridgeAR added a commit that referenced this pull request Jan 10, 2019
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: #20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

@BridgeAR BridgeAR moved this from Backport requested to Backported in v11.x Jan 10, 2019

addaleax added a commit that referenced this pull request Jan 14, 2019
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: #20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: nodejs#20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@BridgeAR BridgeAR referenced this pull request Jan 16, 2019
BridgeAR added a commit to BridgeAR/node that referenced this pull request Jan 16, 2019
process: provide dummy stdio for non-console Windows apps
The only known condition where we could not provide appropriate
stdio streams so far were non-console Windows applications.
Since this issue has come up a few times in our issue tracker now,
switch to providing dummy streams for these cases instead.

If there are other valid cases in which `uv_guess_handle` fails,
and where there is a more sensible way to provide stdio,
we’ll probably still find out because the streams don’t work
properly either way.

Refs: nodejs/help#1251

PR-URL: nodejs#20640
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jan 24, 2019
@Trott

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

This has a backport-requested label, but it cherry-picks cleanly to the current staging branch. (Didn't check to see if the tests pass, but the backport to 11.x for this also lands cleanly on the 10.x-staging branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.