Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #1460
Closed
Open
Issue created Sep 09, 2019 by Administrator@rootContributor

When the OS closes a child process, causes an ERR_IPC_CHANNEL_CLOSED exception, causing the master process to fail.

Created by: pandres95

Description

If the OS (or anyone else) closes the child process, instead of checking its signalCode, the child is released in the pool. This causes an error that leads, when trying to send that child another message, to fail, causing an uncaughtException that closes the main process.

Related error and detais: here

Minimal, Working Test code to reproduce the issue.

Create a project using these two files, that depends on Bull@3.10.0

index.js

'use strict';

const { resolve } = require('path');
const Bull = require('bull');

async function main() {
    const queue = new Bull('myqueue', {
        redis: 'redis://localhost:6379',
        settings: {
            lockDuration: 100000, // Key expiration time for job locks.
            stalledInterval: 100000, // How often check for stalled jobs (use 0 for never checking).
            maxStalledCount: 10, // Max amount of times a stalled job will be re-processed.
            guardInterval: 1000, // Poll interval for delayed jobs and added jobs.
            retryProcessDelay: 5000, // delay before processing next job in case of internal error.
            drainDelay: 20
        }
    });

    try {
        queue.process(resolve(__dirname, './process/index.js'));
        await queue.add({ hello: 'world' });
        await queue.add({ hello: 'world' });
    } catch (error) {
        throw error;
    }
}

main();

process/index.js

'use strict';

const setTimeoutPromise = timeout => new Promise(resolve => setTimeout(() => resolve(), timeout)); 

module.exports = async function () {
    try {
        console.log('opening /my/little/pony.txt');
        await setTimeoutPromise(100000);
        console.log('/my/little/pony.txt opened');
    } catch (error) {
        console.error(error);
    }
};

Open the main process. Run:

node index.js

Kill the child process. Run:

ps -ax | grep master.js | awk '{print $1}' | xargs -I % kill -9 %

Bull version

3.10.0

Additional information

N/A

Assignee
Assign to
Time tracking