Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Create peer discovery packets on a worker thread #955

Merged
merged 3 commits into from
Feb 25, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

Creating peer discovery packets involves cryptographically signing the contents which is a fairly expensive operation. When we do that for a bunch of messages at once, such as when bonding to newly discovered peers, it can cause the Vertx event thread to be blocked for multiple seconds, causing errors and slow processing of incoming messages.

This change moves creation and signing of packets onto worker threads so that the event queue isn't blocked but ensures that the created packet is then delivered back on the event queue to maintain the single-threaded behaviour the code requires.

… is potentially slow causing the Vertx queue to back up.
Copy link
Contributor

@CjHare CjHare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vertx code looks like it should work, whether it fit nicely within the existing area of that codebase is another question, for somebody else 😄

@shemnon
Copy link
Contributor

shemnon commented Feb 25, 2019

LGTM if those who are vertx familiar like it.

@ajsutton ajsutton merged commit f218e0c into PegaSysEng:master Feb 25, 2019
@ajsutton ajsutton deleted the peer-discovery-packets branch February 25, 2019 20:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants