-
Notifications
You must be signed in to change notification settings - Fork 328
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
[api] Re-send pending actions #4498
base: master
Are you sure you want to change the base?
Conversation
45f7028
to
96d9585
Compare
02684d8
to
acb48b7
Compare
Quality Gate passedIssues Measures |
// ActionRadio broadcasts actions to the network | ||
type ActionRadio struct { | ||
broadcastHandler BroadcastOutbound | ||
messageBatcher *batch.Manager | ||
chainID uint32 | ||
unconfirmedActs map[hash.Hash256]*radioAction | ||
mutex sync.Mutex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use ThreadSafeLRU
to hold unconfirmedActs
, then we can remove the mutex?
} | ||
} | ||
}() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are able to remove the mutex, this can be replaced by existing RecurringTask
?
@@ -62,6 +108,58 @@ func (ar *ActionRadio) Stop() error { | |||
|
|||
// OnAdded broadcasts the action to the network | |||
func (ar *ActionRadio) OnAdded(selp *action.SealedEnvelope) { | |||
ar.mutex.Lock() | |||
defer ar.mutex.Unlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comments about removing mutex
Description
Adding an action resend mechanism to prevent a transaction from being stuck due to unsuccessful broadcasting.
Pre PR: #4497
Need further discussion:
How to avoid or alleviate network congestion when dealing with a large number of transactions? Feel free to show your mind
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test Configuration:
Checklist: