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

merge steps in VLV executors for more stability #1496

Merged
merged 4 commits into from
Jun 10, 2020
Merged

Conversation

mstoykov
Copy link
Collaborator

@mstoykov mstoykov commented Jun 9, 2020

Also fix VLV not respecting gracefulStop since 270fd91, add test for it
and try to make some other VLV tests more stable.

The original code (pre 270fd91) did go through all the raw steps
(ramp up/down) and the graceful stop ones concurrently and when the raw
steps ended it will return from Run, but will start a goroutine to go
through the remainign graceful stop ones. The most important of which (
at least in my current understanding) being the last one which is the
actuall gracefulStop end which will make all VUs stop. The reason why
this actually worked is that it also waiting on all activeVUs to have
ended being active, being returned in the new terminology, before it
actually cancels the context for all of them. So if the VUs manage to
end iterations in this time the executor will end earlier if not the
gracefuStop will make them.

270fd91 broke the returning of VUs which lead to the executor never
returning and moving the cancel "before" the waiting for activeVUs fixed
that at the cost of gracefulStop not being taken into account, but with
no tests, nobody noticed.

Here I basically revert that especially because vuHandle now returns VUs
when stopped.

fixes #1473

@mstoykov mstoykov requested review from imiric and na-- June 9, 2020 13:06
@codecov-commenter
Copy link

codecov-commenter commented Jun 9, 2020

Codecov Report

Merging #1496 into new-schedulers will increase coverage by 0.01%.
The diff coverage is 87.87%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           new-schedulers    #1496      +/-   ##
==================================================
+ Coverage           76.79%   76.80%   +0.01%     
==================================================
  Files                 163      163              
  Lines               13039    13028      -11     
==================================================
- Hits                10013    10006       -7     
+ Misses               2515     2509       -6     
- Partials              511      513       +2     
Impacted Files Coverage Δ
lib/helpers.go 100.00% <ø> (ø)
lib/executor/ramping_vus.go 94.23% <87.87%> (+0.13%) ⬆️
stats/cloud/collector.go 78.70% <0.00%> (+0.61%) ⬆️
js/runner.go 83.21% <0.00%> (+0.71%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54a1a45...3e7dcdc. Read the comment docs.

lib/executor/variable_looping_vus.go Outdated Show resolved Hide resolved
// TODO ... thinking about it gracefulExecutionSteps in a lot of cases will lead to nothing so maybe
// we should skip them here?
// TODO better name ... zip is not correct, and combine seems even worse ... merge is not great as
// well though
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge sounds clear enough to me :)

Though I wonder if we can avoid this process, and build the merged execution plan from the start.

Right now getRawExecutionSteps() is called twice: once with zeroEnd==true to build the initial rawExecutionSteps, and a second time in GetExecutionRequirements() with zeroEnd==false to build the gracefulExecutionSteps.

There's likely a way we can avoid this merge step and do a single pass over the stages that produces the same merged plan as this function. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just noticed this and another potential optimization we can do with HasWork(). Not sure if we should tackle this now, or if I shouldn't just make a new performance issue about them...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that is possible future refactor ;) I really want to get this done with so we can know it's not flaky or buggy, while - yes I would argue that this can be done much earlier, possibly with even better names, and even less code :D

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I'll create an issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sounds good.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1499 please comment here

@na-- na-- mentioned this pull request Jun 9, 2020
Copy link
Contributor

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Run is a bit easier to read, and that refactor can wait.

Also fix VLV not respecting gracefulStop since 270fd91, add test for it
and try to make some other VLV tests more stable.

The original code (pre 270fd91) did go through all the raw steps
(ramp up/down) and the graceful stop ones concurrently and when the raw
steps ended it will return from Run, but will start a goroutine to go
through the remainign graceful stop ones. The most important of which (
at least in my current understanding) being the last one which is the
actuall gracefulStop end which will make all VUs stop. The reason why
this actually worked is that it also waiting on all activeVUs to have
ended being active, being returned in the new terminology, before it
actually cancels the context for all of them. So if the VUs manage to
end iterations in this time the executor will end earlier if not the
gracefuStop will make them.

270fd91 broke the returning of VUs which lead to the executor never
returning and moving the cancel "before" the waiting for activeVUs fixed
that at the cost of gracefulStop not being taken into account, but with
no tests, nobody noticed.

Here I basically revert that especially because vuHandle now returns VUs
when stopped.

fixes #1473
lib/executor/ramping_vus.go Outdated Show resolved Hide resolved
lib/executor/ramping_vus.go Outdated Show resolved Hide resolved
lib/executor/ramping_vus.go Outdated Show resolved Hide resolved
Copy link
Member

@na-- na-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

lib/executor/ramping_vus.go Outdated Show resolved Hide resolved
Co-authored-by: na-- <n@andreev.sh>
@mstoykov mstoykov merged commit 0486c11 into new-schedulers Jun 10, 2020
@mstoykov mstoykov deleted the mergeVLVsteps branch June 10, 2020 16:22
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.

None yet

4 participants