From ecd05a697016f9b0bee56ecd3c39bdc4298c7a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BC=E2=80=8D=F0=9F=92=BB=20Romain=20M?= =?UTF-8?q?arcadier-Muller?= Date: Mon, 8 Jun 2020 14:06:49 +0200 Subject: [PATCH] adjust comment --- packages/@jsii/runtime/lib/sync-stdio.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/@jsii/runtime/lib/sync-stdio.ts b/packages/@jsii/runtime/lib/sync-stdio.ts index 70753d3d02..422eb5958e 100644 --- a/packages/@jsii/runtime/lib/sync-stdio.ts +++ b/packages/@jsii/runtime/lib/sync-stdio.ts @@ -38,12 +38,14 @@ export class SyncStdio { } } } catch (e) { - // HACK: node opens STDIN with O_NONBLOCK, meaning attempts to synchrounously read from it may - // result in EAGAIN. In such cases, the call should be retried until it succeeds. This kind of - // polling may be terribly inefficient, and the "correct" way to address this is to stop - // relying on synchronous reads from STDIN. This is however a non-trivial endeavor, and the - // current state of things is very much broken in node >= 13.2, as can be see in - // https://github.com/aws/aws-cdk/issues/5187 + // HACK: node may set O_NONBLOCK on it's STDIN depending on what kind of input it is made + // of (see https://github.com/nodejs/help/issues/2663). When STDIN has O_NONBLOCK, calls may + // result in EAGAIN. In such cases, the call should be retried until it succeeds. This kind + // of polling will result in horrible CPU thrashing, but there does not seem to be a way to + // force a O_SYNC access to STDIN in a reliable way within node. + // In order to make this stop we need to either stop depending on synchronous reads, or to + // provision our own communication channel that can reliably be synchronous. This work is + // "tracked" at https://github.com/aws/aws-cdk/issues/5187 if (e.code !== 'EAGAIN') { throw e; }