-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix(sims): OOM at sim-multi-seed-long run #21503
Conversation
WalkthroughWalkthroughThe changes made to the codebase involve enhancements to memory management and timeout settings in simulation tests, the introduction of a resource management method in the simulation application interface, and improvements to user guidance regarding database backend options. These modifications aim to stabilize long-running simulations and ensure proper resource handling during execution. Changes
Assessment against linked issues
Tip We have updated our review workflow to use the Anthropic's Claude family of models. Please share any feedback in the discussion post on our Discord. 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 using PR comments)
Other keywords and placeholders
Documentation and Community
|
@@ -173,6 +175,8 @@ func NewSimulationAppInstance[T SimulationApp]( | |||
) TestInstance[T] { | |||
t.Helper() | |||
workDir := t.TempDir() | |||
require.NoError(t, os.Mkdir(filepath.Join(workDir, "data"), 0o755)) |
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.
Ensures that the data dir exists for unordered TX
@@ -185,7 +189,7 @@ func NewSimulationAppInstance[T SimulationApp]( | |||
db, err := dbm.NewDB("Simulation", dbm.BackendType(tCfg.DBBackend), dbDir) | |||
require.NoError(t, err) | |||
t.Cleanup(func() { | |||
require.NoError(t, db.Close()) | |||
_ = db.Close() // ensure db is closed |
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 DB is closed by the app on on the happy path now so that errors can be ignored
@alpe your pull request is missing a changelog! |
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.yml
Review profile: CHILL
Files selected for processing (4)
- .github/workflows/sims-nightly.yml (1 hunks)
- scripts/build/simulations.mk (1 hunks)
- testutils/sims/runner.go (7 hunks)
- x/simulation/client/cli/flags.go (1 hunks)
Files skipped from review due to trivial changes (1)
- x/simulation/client/cli/flags.go
Additional context used
Path-based instructions (1)
testutils/sims/runner.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (8)
.github/workflows/sims-nightly.yml (1)
27-28
: LGTM!Setting the
GOMEMLIMIT
environment variable to14GiB
is a good practice to prevent OOM errors during long-running simulations. The comment provides a clear explanation of the purpose of the memory limit, and the value seems reasonable, considering that 2 GiB is reserved as a buffer for GC.scripts/build/simulations.mk (1)
47-47
: Timeout increase is reasonable.Increasing the timeout from 1 hour to 2 hours for the
TestFullAppSimulation
test in thetest-sim-multi-seed-long
target is a reasonable change. It provides more time for the long-running simulation to complete successfully without timing out.testutils/sims/runner.go (6)
6-6
: LGTM!The code change is approved.
54-54
: LGTM!The code change is approved.
128-128
: LGTM!The code change is approved.
138-138
: LGTM!The code change is approved.
144-144
: LGTM!The code change is approved.
179-179
: LGTM!The code change is approved.
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.
Amazing, thank you!!
(cherry picked from commit 62bf23a) # Conflicts: # testutils/sims/runner.go
Co-authored-by: Alexander Peters <[email protected]> Co-authored-by: Julien Robert <[email protected]>
Resolves #21415
With this PR, the
GOMEMLIMIT
is set for thetest-sim-multi-seed-long
CI run. The variable sets a soft memory limit for the Go runtime. With the additional buffer the GC prevents the OOM.Also the
app.Close()
method is called within the test forks to release resources as soon as possible.Summary by CodeRabbit
New Features
Improvements
Bug Fixes