Skip to content

Conversation

@janschu99
Copy link

Most importantly:

  • Added network latency simulation
  • Made simulator usable without log4j
  • Made tracing of messages optional
  • Fixed that nodes could read the local timestamp of any other node

Previously nodes could start and stop themselves and even all other nodes. Additionally, the local timestamp of every node was publicly visible (but even after this change it's unfortunately still accessible from other nodes of the same class, which cannot be prevented using Java method visibilities).
Even if logging using log4j was disabled, it was still loaded when initializing the simulator, which would fail and cause an exception if no log4j library could be found
… optional

The previous static methods to create a "default" simulator have been replaced by a simpler constructor for a simulator without tracing. If applications want to use the tracing feature, they will need to specify all required parameters. The "orderedTracing" parameter has been removed since it did nothing anyway. Tracing of messages is now optional and can be controlled by a new constructor parameter. Disabling it might be useful for improving performance or if applications want to print their own status messages instead.
Instead of always printing them to System.err
By sleeping a random duration (up to a configurable upper bound) before returning the next message
Instead of seconds, to enable more precise control and be more consistent with other blocking operations from the Java libraries (sleep, wait, ...)
Makes debugging and analyzing thread dumps a lot easier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant