do not timeout on faulty async handlers, continue with false to give default handlers chance to run

This commit is contained in:
Jörg Breitbart
2021-02-28 13:53:06 +01:00
parent 48a93c379f
commit cdd238d75e
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -484,8 +484,13 @@ export class InputHandler extends Disposable implements IInputHandler {
private _logSlowResolvingAsync(p: Promise<boolean>): void {
// log a limited warning about an async taking too long
if ((this._logService as any)._logLevel <= LogLevel.WARN) {
Promise.race([p, new Promise((res, rej) => setTimeout(rej, SLOW_ASYNC_LIMIT))])
.catch(() => console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`));
Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])
.catch(err => {
if (err !== '#SLOW_TIMEOUT') {
throw err;
}
console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);
});
}
}
+1 -1
View File
@@ -167,7 +167,7 @@ export class WriteBuffer {
// (executed on the same queue, thus properly aligned before continuation happens)
result.catch(err => {
qmt(() => {throw err;});
return Promise.resolve(true);
return Promise.resolve(false);
}).then(continuation);
return;
}