-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix(submit loop): correctly load commit on startup #1011
Conversation
WalkthroughThe recent changes enhance the efficiency of the submission process by refining the timing mechanism and altering data retrieval methods. The Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- block/submit.go (2 hunks)
Additional comments not posted (2)
block/submit.go (2)
243-243
: Verify the correctness of loading commits.The change from loading blocks to loading commits should be verified to ensure it aligns with the intended functionality and does not introduce errors.
Verification successful
Verification successful for loading commits.
The use of
LoadCommit
in theblock/submit.go
file aligns with its intended functionality and does not introduce errors. The function is correctly implemented and its usage is consistent throughout the codebase. No issues were found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of using LoadCommit in GetUnsubmittedBytes. # Test: Search for the definition and usage of LoadCommit to ensure it is used correctly. rg --type go -A 5 $'LoadCommit'Length of output: 11348
56-56
: Verify the impact of the ticker interval change.The ticker interval has been reduced to
maxBatchTime / 10
, which should enhance responsiveness. Ensure that this change does not lead to excessive CPU usage or other unintended side effects.
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- block/submit.go (2 hunks)
Additional comments not posted (2)
block/submit.go (2)
243-243
: LGTM! Verify the correctness of commit loading logic.The change in
GetUnsubmittedBytes
to load commits instead of blocks aligns with the updated data retrieval logic. Ensure that this change is consistent with the intended functionality and does not introduce any discrepancies.
56-56
: LGTM! Verify the impact on system performance.The change to the ticker interval in
SubmitLoopInner
enhances responsiveness by allowing more frequent checks. Ensure that this does not adversely affect system performance or stability under various load conditions.
@@ -53,7 +53,7 @@ func SubmitLoopInner( | |||
|
|||
eg.Go(func() error { | |||
// 'trigger': we need one thread to continuously consume the bytes produced channel, and to monitor timer | |||
ticker := time.NewTicker(maxBatchTime) | |||
ticker := time.NewTicker(maxBatchTime / 10) // interval does not need to match max batch time since the other thread keeps track of the actual time |
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.
as on the original pr, it would be much clearer if the trigger
thread would actually trigger the submitter
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 does on line 78
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.
(cherry picked from commit f3e69a3)
PR Standards
Opening a pull request should be able to meet the following requirements
--
PR naming convention: https://hackmd.io/@nZpxHZ0CT7O5ngTp0TP9mg/HJP_jrm7A
Close #XXX
<-- Briefly describe the content of this pull request -->
For Author:
godoc
commentsFor Reviewer:
After reviewer approval:
Summary by CodeRabbit
These changes aim to optimize performance and accuracy in managing submissions within the system.