Coder Social home page Coder Social logo

jresp's People

Contributors

albertolluch avatar andreamargheri avatar lorecro avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jresp's Issues

Bug: Concurrency and resource issues in Node.java when creating large amount of Agents.

In Node.java, the Executor executor providing threads to a NodeThread is not being shutdown properly, which can cause several issues:

  • Resources are allocated for the executor.execute(new NodeMessageHandler(m)) in line 282, are never released or closed properly in start() in line 1106, nor in when the Node is terminated, nor in doStop() in line 636. This means that one can create a node, and allocate arbitratry many agents, and jResp will barf.
  • Because Executor does not implement a way of shutting down in line 374, one leaves the resource deallocation to garbage collector, and that does never happen because the Nodes are never deallocated. This has performance issues when creating several nodes with many agents.

This already gives a slugish or non-existent performance when doing around 1 node and a 1000 agents.

A way to solve this is to:

  • [Implement doStop()] Implement the doStop() and release all resources graceful.
  • [Change the Executor] Use ExecutorService instead Executor and release all resources gracefully with shutdownNow().
  • [Remove Agents] Release the Agents attached to a Node as commented out in stop() in line 1151, or remove the references to the Agents when closing a Node objects (if Agents are in a reused in some way).

This should stop the leakage, help on jResp performance, and reduce the dependency on garbage collector doing the magic.

PointToPoint constructor given wrong information -> NullPointerException

Hello!
It seems that a bug can be provoked by the following behavior.

If a PointToPoint object is initialized with a name of a Node that does not exist, the program will not compile and return a NullPointerException, instead of a relaying a more useful message to the user :)

I have a sample program that will provoke the bug:
PointToPointConstructorExample.zip

In line 43 and 45, the PointToPoint object is initialized with wrong Node names, thus provoking the bug. Changing the names to Node1 and Node2 respectively, the exception will not be raised.

Regarding the jResp code, I have only taken a brief look at it and have not found the correct explanation or solution, but it seems that in the method sendPutRequest in Node.java, the call:

  return pending.get();

at https://github.com/michele-loreti/jResp/blob/master/CORE/org.cmg.jresp.core/src/org/cmg/jresp/comp/Node.java#L1063

returns a null value for some reason.

Thanks :)

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.