-
Notifications
You must be signed in to change notification settings - Fork 11
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
Retry all payment session with actor message #430
Merged
quake
merged 6 commits into
nervosnetwork:develop
from
chenyukang:fix-error-handling-issue-407
Jan 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
851452f
Retry all payment session with actor message
chenyukang ba2d2bc
Merge branch 'develop' into fix-error-handling-issue-407
chenyukang 6b3c9e4
Merge branch 'develop' into fix-error-handling-issue-407
chenyukang 513ad0a
add TickStore event for process channel update immediately
chenyukang 8d36499
merge develop and resolve conflicts
chenyukang 974b118
use BroadcastMessages for send payment update
chenyukang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is possible that even after 0.5 seconds the
ChannelUpdate
contained in the error message is still not processed. This is because this message would first be saved to the gossip message store and by default the interval to save messages to the store is 20s. https://github.com/contrun/fiber/blob/ea5c1fede9bffd8d3f3fa49d2570aadb971fcb6f/src/fiber/gossip.rs#L1179-L1181 https://github.com/contrun/fiber/blob/ea5c1fede9bffd8d3f3fa49d2570aadb971fcb6f/src/fiber/config.rs#L61-L62 .In this case, I think we need to notify the gossip actor to start process the messages in the queue immediately (either create a new message like
TickImmediately
for the gossip actor or rename theProcessBroadcastMessage
toProcessBroadcastMessageImmediately
and change the handler to immediately process messages in the queue). Note that it is still possible that when there are too many messages in the queue this message can still not be processed after 0.5s.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.
it's 60s, not 20s ?
fiber/src/fiber/config.rs
Lines 52 to 54 in ba2d2bc
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.
got it.
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.
yeah, there is a chance the message is not processed in 0.5 second, any other better way ? I think we should not make a huge change because of this requirement.
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.
e909f92
I make this change, how do you think about it?
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.
I prefer changing the action
ProcessBroadcastMessage
to changing the underlying data structureChannelUpdate
. To be specific, I think add an additional boolean parameter of https://github.com/contrun/fiber/blob/b78812b7584c290563f54d21842eafce0d33d707/src/fiber/gossip.rs#L318-L321ProcessBroadcastMessage
to indicate if we need to process the message immediately will be better. This boolean parameter will intoxicate a few functions/data structures, but its meaning is clearer thanChannelUpdateImmediately
.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.
done with 37070e2
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 another solution: 513ad0a