Skip to content
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

Eliminate VU races, unify execution loop, remove cpu check loop #1505

Merged
merged 18 commits into from
Dec 19, 2024

Conversation

skudasov
Copy link
Collaborator

@skudasov skudasov commented Dec 19, 2024


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes introduced are aimed at enhancing thread safety and error handling within the virtual user (VU) management and paced call functionality of a load testing tool. Specifically, ensuring mutual exclusion when accessing shared resources and improving robustness in the rate-limited call execution.

What

  • wasp/wasp.go
    • In the runExecuteLoop function, mutual exclusion locks (currentSegmentMu.Lock() and currentSegmentMu.Unlock()) are added around the code block where virtual users (g.vus) are appended to the slice. This ensures thread safety when modifying the shared g.vus slice.
    • In the processSegment function, similar mutual exclusion locks are added around sections where the g.vus slice is either trimmed or appended to, depending on the new virtual user count. This change prevents concurrent write issues.
    • The pacedCall function is modified to include a preliminary nil check on the rate limiter (g.rl) reference before attempting to invoke its Take() method. This addition prevents potential nil pointer dereferences, enhancing the function's robustness.

@skudasov skudasov requested review from sebawo and a team as code owners December 19, 2024 01:09
@skudasov skudasov changed the base branch from main to tt-1741-performance-comparison-tool December 19, 2024 01:09
@skudasov skudasov changed the title Fix vu creation races Eliminate VU races, unify execution loop Dec 19, 2024
@skudasov skudasov changed the title Eliminate VU races, unify execution loop Eliminate VU races, unify execution loop, remove cpu check loop Dec 19, 2024
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
15.4% Duplication on New Code (required ≤ 5%)

See analysis details on SonarQube

@Tofel Tofel merged commit cb02f63 into tt-1741-performance-comparison-tool Dec 19, 2024
49 of 53 checks passed
@Tofel Tofel deleted the fix-vu-creation-races branch December 19, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants