Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set message processing asynchronous #454

Merged

Conversation

Neylix
Copy link
Member

@Neylix Neylix commented Jul 17, 2022

Description

When the node receive a message, it is catched by a message producer and send to a worker. All workers can handle one message at a time, so if all workers are busy, the message producer will add new messages in a queue, waiting for worker to be freed.
The problem is that all workers process the message synchronously, and so if they are on a long processing time message, message in the queue can go on timeout.

The idea here it to create a new task that will process the message and so message workers just create this task and don't wait message processing time. They are quiclky freed to get another message

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added some log in the message producer queue.
Without modification, when the receive a lot of message, there is a lot if message in the queue and some fall in timeout.
With the modification, there is only few messages waiting in the queue, and they are catched by a worker very quickly

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Neylix Neylix added bug Something isn't working P2P Involve P2P networking labels Jul 17, 2022
@Neylix Neylix merged commit 051e8c9 into archethic-foundation:develop Jul 18, 2022
@Neylix Neylix deleted the Improve-P2P-Broadway-handler branch July 18, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2P Involve P2P networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant