Coder Social home page Coder Social logo

Comments (4)

tromai avatar tromai commented on September 18, 2024

Looking into the scan method in registry.py. In this block, if an Exception happens, we return the check results without putting the runner which was handling the Error check back into runner_queue. That is why during the next analysis, our runner is not available.
Suggested fix:

if current_future.exception(timeout=self.runner_timeout):
    logger.error("Exception in check %s: %s.", current_check_id, current_future.exception())
    info("Check %s has failed.", current_check_id)
    current_future.cancel()
    # Fix here.
    self.runner_queue.put(current_runner)
    return results

Another solution is to put the exception handling to the Runner itself (so if an exception happens, each runner instance will catch it and put itself back into the queue.

from macaron.

behnazh-w avatar behnazh-w commented on September 18, 2024

If an exception happens in a check in the analysis of software component, the corresponding analysis should fail. However, the other analysis instances that will run dependencies for instance should keep running. I'm not sure if your suggested fix is helpful in this case.

from macaron.

tromai avatar tromai commented on September 18, 2024

Yes, it should fail for the current software component we are analyzing. However, because if we don't put the runner back to the runner queue (we only have one runner at the moment), in the next analysis of the next software component, the runner queue is empty and no runner will be able to run the analysis for the rest of the software component.
The reason we need to manually put the runner back is because if an exception happens before this line (which is potentially inside check.run the runner cannot put itself back to the runner queue).

from macaron.

behnazh-w avatar behnazh-w commented on September 18, 2024

OK, please go ahead with the PR to continue the discussion.

from macaron.

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.