Skip to content

[help] ERR_WORKER_INVALID_PACKET error #7

Description

@ggb88

I'm running node.js app with bthreads 0.5.1 and spawning (in this case) 3 processes with the same source file using
require('bthreads/process');

....

    start() {
        this._worker = new threads.Worker(this._workerFilename, {
            workerData: this._workerData
        });

        this._worker.once('exit', (code) => {
            this.emit('done');
        });
    } 

These can be long running processes - after approx 10 mins of processing, the following error occurs:

Error [ERR_WORKER_INVALID_PACKET]: Received invalid packet (10).
    at Parser.parseHeader (/Users/.../node_modules/bthreads/lib/process/parser.js:138:13)
    at Parser.parse (/Users/.../node_modules/bthreads/lib/process/parser.js:103:23)
    at Parser.feed (/Users/.../node_modules/bthreads/lib/process/parser.js:50:12)
    at Socket.<anonymous> (/Users/.../node_modules/bthreads/lib/process/worker.js:355:22)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:182:23)

The only lead I have is that when I reduce the amount of console logging (to simulate prod ops) the problem has not recurred. That said, I'd rather try and find the issue rather than hope it doesn't occur in prod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions