dcp-client 5.1.10 → 5.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dcp-client-bundle.js +1 -1
- package/dist/dcp-client-bundle.js.map +1 -1
- package/lib/standaloneWorker.js +0 -16
- package/libexec/sandbox/bravojs-env.js +1 -1
- package/libexec/sandbox/fetch-factory.js +3 -5
- package/libexec/sandbox/polyfills.js +0 -1
- package/package.json +2 -2
- package/build/etc/config.cache +0 -3
package/lib/standaloneWorker.js
CHANGED
|
@@ -56,7 +56,6 @@ function StandaloneWorker(options = {})
|
|
|
56
56
|
var connected = false
|
|
57
57
|
var dieTimer
|
|
58
58
|
var shutdown;
|
|
59
|
-
var connectTimer = false;
|
|
60
59
|
|
|
61
60
|
Reference.call(this, debugging, () => `sa-worker@${this.serial}/${this.config.location}`);
|
|
62
61
|
const defaultConfig = {
|
|
@@ -93,17 +92,7 @@ function StandaloneWorker(options = {})
|
|
|
93
92
|
if (!readStream) {
|
|
94
93
|
/* No supplied streams - reach out and connect over TCP/IP */
|
|
95
94
|
let socket = readStream = writeStream = new (require('net')).Socket().unref();
|
|
96
|
-
let connecting = true;
|
|
97
|
-
|
|
98
95
|
debugging() && console.debug('Connecting to evaluator on', this.config.location.hostname + ':' + this.config.location.port);
|
|
99
|
-
connectTimer = setBackoffInterval(function saWorker$$connect$backoff() {
|
|
100
|
-
if (!connecting)
|
|
101
|
-
{
|
|
102
|
-
connecting = true;
|
|
103
|
-
socket.connect(that.config.location.port, that.config.location.hostname, () => { connecting = false; });
|
|
104
|
-
}
|
|
105
|
-
}, this.config.tuning.connectBackoff);
|
|
106
|
-
connectTimer.unref();
|
|
107
96
|
|
|
108
97
|
socket.setNoDelay(this.config.tuning.noDelay ?? true);
|
|
109
98
|
socket.connect(this.config.location.port, this.config.location.hostname);
|
|
@@ -123,7 +112,6 @@ function StandaloneWorker(options = {})
|
|
|
123
112
|
socket.on('end', sandboxDeath);
|
|
124
113
|
|
|
125
114
|
socket.on('error', function saWorker$$socket$errorHandler(e) {
|
|
126
|
-
connecting = false;
|
|
127
115
|
debugging() && console.debug(`Evaluator ${this.serial} - socket error:`,
|
|
128
116
|
e.code === 'ECONNREFUSED' ? e.message : e);
|
|
129
117
|
if (options.onsocketerror)
|
|
@@ -175,7 +163,6 @@ function StandaloneWorker(options = {})
|
|
|
175
163
|
|
|
176
164
|
function beginSession () {
|
|
177
165
|
connected = true
|
|
178
|
-
clearBackoffInterval(connectTimer);
|
|
179
166
|
|
|
180
167
|
readStream.on ('error', shutdown);
|
|
181
168
|
readStream.on ('end', shutdown);
|
|
@@ -327,7 +314,6 @@ function StandaloneWorker(options = {})
|
|
|
327
314
|
|
|
328
315
|
/* Shutdown the stream(s) which are connected to the evaluator */
|
|
329
316
|
shutdown = (e) => {
|
|
330
|
-
clearBackoffInterval(connectTimer);
|
|
331
317
|
|
|
332
318
|
if ((e instanceof Error) && isErrorReportable(e))
|
|
333
319
|
console.error(e);
|
|
@@ -370,8 +356,6 @@ function StandaloneWorker(options = {})
|
|
|
370
356
|
this.unref();
|
|
371
357
|
}
|
|
372
358
|
|
|
373
|
-
clearBackoffInterval(connectTimer);
|
|
374
|
-
|
|
375
359
|
/* If DIE: response doesn't arrive in a reasonable time -- clean up */
|
|
376
360
|
dieTimer = setTimeout(shutdown, 7000);
|
|
377
361
|
dieTimer.unref();
|
|
@@ -346,7 +346,7 @@ prepPyodide`);
|
|
|
346
346
|
/* Report an error from the work function to the supervisor */
|
|
347
347
|
function reportError (error, metrics)
|
|
348
348
|
{
|
|
349
|
-
|
|
349
|
+
const err = new Error('initial state');
|
|
350
350
|
|
|
351
351
|
for (let prop of [ 'message', 'name', 'code', 'stack', 'lineNumber', 'columnNumber' ])
|
|
352
352
|
{
|
|
@@ -644,11 +644,9 @@ self.wrapScriptLoading({ scriptName: 'fetch-factory', ringTransition: true }, fu
|
|
|
644
644
|
promise.resolve(ev.data);
|
|
645
645
|
break;
|
|
646
646
|
case 'fetchError': {
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
err.stack = ev.error.stack;
|
|
651
|
-
promise.reject(err);
|
|
647
|
+
// Don't need to reconstruct the error here because it is done in
|
|
648
|
+
// function reportError (error, metrics) is bravojs-env.js
|
|
649
|
+
promise.reject(ev.error);
|
|
652
650
|
break;
|
|
653
651
|
}
|
|
654
652
|
}
|
|
@@ -155,7 +155,6 @@ self.wrapScriptLoading({ scriptName: 'polyfills' }, function accessLists$$fn(pro
|
|
|
155
155
|
* @return {Promise<string>}
|
|
156
156
|
*/
|
|
157
157
|
async text() {
|
|
158
|
-
debugger;
|
|
159
158
|
// More optimized than using this.arrayBuffer()
|
|
160
159
|
// that requires twice as much ram
|
|
161
160
|
const decoder = new TextDecoder();
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dcp-client",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.11",
|
|
4
4
|
"dcp": {
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "9f78dfbb5671e31a2a41670c694fd05a56962d65",
|
|
6
6
|
"repository": "git@gitlab.com:Distributed-Compute-Protocol/dcp.git"
|
|
7
7
|
},
|
|
8
8
|
"description": "Core libraries for accessing DCP network",
|
package/build/etc/config.cache
DELETED