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

Loadgen startup fix #4087

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Conversation

marta-lokhova
Copy link
Contributor

Resolves #4071

Copy link
Contributor

@SirTyson SirTyson left a comment

Choose a reason for hiding this comment

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

Looks good! I think we can clean up the start function a little more though.

LoadGenerator::start(GeneratedLoadConfig& cfg)
{
// Setup config for soroban modes
if (!mStarted && cfg.isSoroban())
Copy link
Contributor

Choose a reason for hiding this comment

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

start should be a no-op except on the first invocation, so why not add if (mStarted) return; at the beginning and get rid of the checks in the individual ifs. Currently the only functions that get called multiple times in start are createRootAccount and updateMinBalance. If we need to call those periodically they probably don't belong in start (but I don't think we do).

GeneratedLoadConfig::areTxsRemaining() const
{
return (isCreate() && nAccounts != 0) || (!isCreate() && nTxs != 0);
createRootAccount();
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we have a single start function, we should change if (!mRoot) to releaseAssert(!mRoot) in createRootAccount().

&VirtualTimer::onFailureNoop);
}
else
if (!mStartTime)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should change this to releaseAssert(!mStartTime) (assuming you implement my other comment where we exit early in start()).

@marta-lokhova marta-lokhova force-pushed the loadgen_race_cond branch 2 times, most recently from 498c2da to ad064ba Compare December 20, 2023 04:40
@marta-lokhova
Copy link
Contributor Author

@SirTyson added your suggestions, so this should be ready now

Copy link
Contributor

@SirTyson SirTyson left a comment

Choose a reason for hiding this comment

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

LGTM, one small nit.

src/simulation/LoadGenerator.cpp Show resolved Hide resolved
@sisuresh
Copy link
Contributor

r+ fce809d

@latobarita latobarita merged commit db14cbc into stellar:master Dec 20, 2023
15 checks passed
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.

load generator: race condition on startup
4 participants