- Notifications
You must be signed in to change notification settings - Fork 10
Stresstest fix - Add limits to the graph mutation stress test #244
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
Conversation
🔧 Report generated by pr-comment-scanbuild |
public void link(GraphNode node) { | ||
nodes.add(node); | ||
// Simple round-robin replacement - no expensive size checks or polling | ||
int index = (linkIndex++) % MAX_LINKS; |
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.
The increment operator is not atomic, unfortunately.
You can use AtomicInteger
for the linkIndex instead.
// Optional: method to access links if needed for verification | ||
public GraphNode getLink(int index) { | ||
return links.get(index % MAX_LINKS); |
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.
Is this used/going to be used soon?
80a2a60
to 9762603
Compare Thanks for the feedback, |
9762603
to c58e008
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.
Looks reasonable.
Just in case - did you check that the stresstest counters are somewhat comparable before and after this change?
This leads to comparable results |
What does this PR do?:
Add limits to the number of nodes and links.
Motivation:
Ensure we don't go in OOM error in the stresstest.
Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a review from
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!