Git Product home page Git Product logo

Comments (4)

MarianoFacundoArch avatar MarianoFacundoArch commented on August 16, 2024 1

Found the issue, thank you.

There was a library that is made with workerpool, and i use that library in another part of the code after the workerpool

from workerpool.

josdejong avatar josdejong commented on August 16, 2024

So what are you doing exactly? How to reproduce your issue?

from workerpool.

MarianoFacundoArch avatar MarianoFacundoArch commented on August 16, 2024

I have a promise that takes more than that amount of time.

        result = await jobsPool
          .exec("performExecutionOfSpecificJob", [
            jobToProcess._id.toString(),
            jobToProcess.client._id.toString(),
            JSON.stringify(configToProcess),
            jobToProcess.notificationsCallback,
          ])

That is the exact code.
Thinking there might be some default, I even added the timeout line with a 120 minutes timeout but the error with the 600000 milliseconds still occur

        result = await jobsPool
          .exec("performExecutionOfSpecificJob", [
            jobToProcess._id.toString(),
            jobToProcess.client._id.toString(),
            JSON.stringify(configToProcess),
            jobToProcess.notificationsCallback,
          ])
          .timeout(configProvider.HARD_TIMEOUT_FOR_JOB_IN_MINUTES * 60 * 1000);

from workerpool.

josdejong avatar josdejong commented on August 16, 2024

I tried to reproduce your issue with the following minimal example, running the script for more than 10 minutes, but the error does not occur:

const workerpool = require('workerpool');
const pool = workerpool.pool();

// Test issue https://github.com/josdejong/workerpool/issues/380

function testTimeout() {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve(42)
    }, 10 * 600_000) // more than the magic 600000
  });
}

async function run () {
  console.log('started at', new Date().toISOString())
  console.log('should throw a timeout exception after 600000 ms (10 minutes)')

  const result = await pool.exec(testTimeout, [])
  console.log('result', result)

  await pool.terminate()
}

run().catch(console.error)

Can you provide a minimal example (with workerpool only involved) that demonstrates the issue?

from workerpool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.