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
  • #1179
Closed
Open
Issue created Jan 16, 2019 by Administrator@rootContributor

MaxListenersExceededWarning caused by Sandbox.js

Created by: zlafil

Bull version: 3.5.2

It seems that sandbox.js never removes the listener for the exit event. This causes the MaxListenersExceededWarning to be shown in Node.

https://github.com/OptimalBits/bull/blob/develop/lib/process/sandbox.js#L36

Example in TypeScript

 const queue = new Bull("Queue", { redis: { port: Config.config.redisPort, host: Config.config.redisHost } });
  queue.process(1, "pathToWorker.js");
  for (let i = 0; i < 12; i++) {
    queue.add("");
  }

Adding

child.removeListener('exit');

before this line https://github.com/OptimalBits/bull/blob/develop/lib/process/sandbox.js#L41 seems to solve the problem

Assignee
Assign to
Time tracking