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

[backport] avoid processing same ATX in parallel (#5379) #5382

Merged
merged 2 commits into from
Dec 21, 2023

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Dec 20, 2023

Cherry-pick #5379

## Motivation
There is no mechanism preventing duplicated processing of ATX in parallel. An ATX might be gossiped multiple times while the same one is already being processed. Related issue: #4426

## Changes
The ATX handler now registers the ATXID when it starts processing it. The subsequent calls to `handleATX()` will find that the handler is already processing this ATX and will register themself for the result, which is sent over a channel after the ATX processing is finished.

## Test Plan
Added a UT in which an ATX is gossiped 10x in parallel. The expectation is that it's processed only once.
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (ee8b43b) 77.6% compared to head (ad354f1) 77.5%.
Report is 1 commits behind head on v1.2.

Files Patch % Lines
activation/handler.go 93.1% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            v1.2   #5382     +/-   ##
=======================================
- Coverage   77.6%   77.5%   -0.1%     
=======================================
  Files        256     256             
  Lines      30478   30506     +28     
=======================================
+ Hits       23659   23672     +13     
- Misses      5334    5351     +17     
+ Partials    1485    1483      -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poszu poszu changed the title Avoid processing same ATX in parallel (#5379) [backport] avoid processing same ATX in parallel (#5379) Dec 20, 2023
@poszu poszu merged commit a115beb into v1.2 Dec 21, 2023
22 of 24 checks passed
@poszu poszu deleted the v1.2-avoid-processing-atx-many-times branch December 21, 2023 10:33
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.

2 participants