Skip to content

Commit a2900b4

Browse files
committed
HACK! DO NOT MERGE TO TRUNK! ignore vatCancelled
refs #5507 This removes the `Promise.race([vatCancelled, result])` calls which might be triggering the V8 bug in which heavily-used-but-unresolved promises accumulate state forever.
1 parent 590e8b9 commit a2900b4

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

packages/xsnap/src/xsnap.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export function xsnap(options) {
134134
const vatCancelled = vatExit.promise.then(() => {
135135
throw Error(`${name} exited`);
136136
});
137+
vatCancelled.catch(() => console.log(`vatCancelled being ignored`));
137138

138139
const writer = xsnapProcess.stdio[3];
139140
const reader = xsnapProcess.stdio[4];
@@ -212,7 +213,8 @@ export function xsnap(options) {
212213
return runToIdle();
213214
});
214215
baton = result.then(() => {}).catch(() => {});
215-
return Promise.race([vatCancelled, result]);
216+
//return Promise.race([vatCancelled, result]);
217+
return result;
216218
}
217219

218220
/**
@@ -225,7 +227,8 @@ export function xsnap(options) {
225227
await runToIdle();
226228
});
227229
baton = result.catch(() => {});
228-
return Promise.race([vatCancelled, result]);
230+
//return Promise.race([vatCancelled, result]);
231+
return result;
229232
}
230233

231234
/**
@@ -238,7 +241,8 @@ export function xsnap(options) {
238241
await runToIdle();
239242
});
240243
baton = result.catch(() => {});
241-
return Promise.race([vatCancelled, result]);
244+
//return Promise.race([vatCancelled, result]);
245+
return result;
242246
}
243247

244248
/**
@@ -250,7 +254,8 @@ export function xsnap(options) {
250254
await runToIdle();
251255
});
252256
baton = result.catch(() => {});
253-
return Promise.race([vatCancelled, result]);
257+
//return Promise.race([vatCancelled, result]);
258+
return result;
254259
}
255260

256261
/**
@@ -269,7 +274,8 @@ export function xsnap(options) {
269274
() => {},
270275
() => {},
271276
);
272-
return Promise.race([vatCancelled, result]);
277+
//return Promise.race([vatCancelled, result]);
278+
return result;
273279
}
274280

275281
/**
@@ -291,7 +297,8 @@ export function xsnap(options) {
291297
await runToIdle();
292298
});
293299
baton = result.catch(() => {});
294-
return Promise.race([vatExit.promise, baton]);
300+
//return Promise.race([vatExit.promise, baton]);
301+
return baton;
295302
}
296303

297304
/**

0 commit comments

Comments
 (0)