-
Notifications
You must be signed in to change notification settings - Fork 115
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
Full node streaming batch size reset to 2000, properly zero out cache on flush #2068
Conversation
jonfung-dydx
commented
Aug 9, 2024
•
edited
Loading
edited
- properly zero out the cache
- emit metrics on # streamUpdates
- reset max batch size default to 2000
WalkthroughThis update enhances GitHub Actions workflows by enabling triggers on branches prefixed with 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 (5)
- .github/workflows/protocol-build-and-push-snapshot.yml (1 hunks)
- .github/workflows/protocol-build-and-push.yml (1 hunks)
- protocol/app/flags/flags.go (1 hunks)
- protocol/app/flags/flags_test.go (4 hunks)
- protocol/streaming/full_node_streaming_manager.go (5 hunks)
Additional comments not posted (10)
.github/workflows/protocol-build-and-push.yml (1)
7-7
: Approve the addition of branch patternjonfung/**
.The addition of the
jonfung/**
branch pattern under thepush
event enhances flexibility by allowing workflows to trigger on branches prefixed withjonfung/
. This is a beneficial change for development processes..github/workflows/protocol-build-and-push-snapshot.yml (1)
7-7
: Approve the addition of branch patternjonfung/**
.The addition of the
jonfung/**
branch pattern under thepush
event enhances flexibility by allowing workflows to trigger on branches prefixed withjonfung/
. This is a beneficial change for development processes.protocol/app/flags/flags.go (1)
67-68
: Verify the appropriateness of reduced gRPC streaming constants.The constants
DefaultGrpcStreamingMaxBatchSize
andDefaultGrpcStreamingMaxChannelBufferSize
have been significantly reduced from1000000
to2000
. Ensure these new values are suitable for the expected workload and do not negatively impact performance.protocol/app/flags/flags_test.go (2)
83-84
: Verify the impact of reduced gRPC streaming parameters.The reduction of
GrpcStreamingMaxBatchSize
andGrpcStreamingMaxChannelBufferSize
to 2000 across multiple test cases suggests a shift towards stricter limits. Ensure that these changes align with the intended system behavior and performance expectations.Also applies to: 133-133, 143-143
186-187
: Ensure consistency with intended configuration defaults.The default values for
GrpcStreamingBatchSize
andGrpcStreamingMaxChannelBufferSize
are set to 2000. Verify that these defaults align with the overall system configuration strategy.protocol/streaming/full_node_streaming_manager.go (5)
353-353
: LGTM! Refactoring improves readability.The removal of the
numUpdatesToAdd
parameter from theAddUpdatesToCache
call simplifies the method and enhances readability.
396-396
: LGTM! Consistent refactoring with improved readability.The removal of the
numUpdatesToAdd
parameter from theAddUpdatesToCache
call aligns with the refactoring strategy, enhancing readability.
414-423
: LGTM! Simplified data structure reduces complexity.The restructuring of the data passed to
AddUpdatesToCache
reduces complexity and aligns with the refactoring efforts.
Line range hint
427-457
:
LGTM! Streamlined method enhances maintainability.The removal of the
numUpdatesToAdd
parameter and the simplification of cache clearing logic improve maintainability and performance.
506-507
: LGTM! Simplified cache clearing improves clarity.The direct setting of the cache to
nil
clarifies the intent of cache clearing and simplifies the method.
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)
- protocol/streaming/full_node_streaming_manager.go (7 hunks)
Additional comments not posted (4)
protocol/streaming/full_node_streaming_manager.go (4)
356-356
: Simplified update handling looks good!The changes in
SendOrderbookUpdates
improve readability by removing the explicit count of updates. Ensure that the logic for grouping updates remains correct.
399-399
: Consistent simplification in update handling!The changes in
SendOrderbookFillUpdates
maintain consistency withSendOrderbookUpdates
by simplifying the call toAddUpdatesToCache
. This enhances code clarity.
417-426
: Simplified taker order status update handling!The changes in
SendTakerOrderStatus
align with the simplifications in other methods, enhancing code clarity and consistency.
Line range hint
430-460
: Cache management simplification is effective!The removal of
numUpdatesToAdd
parameter inAddUpdatesToCache
simplifies the method. Ensure that the cache management logic, particularly the overflow handling, is correct.
7abe7ed
to
67de632
Compare
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)
- protocol/streaming/full_node_streaming_manager.go (7 hunks)
Files skipped from review as they are similar to previous changes (1)
- protocol/streaming/full_node_streaming_manager.go
67de632
to
c6a3974
Compare
@@ -501,8 +503,8 @@ func (sm *FullNodeStreamingManagerImpl) FlushStreamUpdatesWithLock() { | |||
} | |||
} | |||
|
|||
clear(sm.streamUpdateCache) | |||
clear(sm.streamUpdateSubscriptionCache) | |||
sm.streamUpdateCache = nil |
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.
will this work? vs. setting to empty array
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.
yep, tested