Skip to content

chore: bump kwil-db depedencies to prevent OOM crash#1336

Merged
MicBun merged 2 commits intomainfrom
updateGomod
Mar 13, 2026
Merged

chore: bump kwil-db depedencies to prevent OOM crash#1336
MicBun merged 2 commits intomainfrom
updateGomod

Conversation

@MicBun
Copy link
Member

@MicBun MicBun commented Mar 13, 2026

resolves: #1316
reflecting changes based on trufnetwork/kwil-db#1682

Summary by CodeRabbit

  • Performance Enhancements

    • Added memory and garbage collection tuning for database services to improve efficiency and stability
    • Increased container memory limits from 1.5GB to 3GB for improved reliability under load
  • Chores

    • Updated core dependencies to newer revisions for ongoing maintenance and compatibility

@MicBun MicBun requested a review from pr-time-tracker March 13, 2026 14:06
@MicBun MicBun self-assigned this Mar 13, 2026
@holdex
Copy link

holdex bot commented Mar 13, 2026

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 4h Update time Mar 13, 2026, 2:18 PM

You can submit time with the command. Example:

@holdex pr submit-time 15m

See available commands to help comply with our Guidelines.

@coderabbitai
Copy link

coderabbitai bot commented Mar 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f89823ad-43dc-4585-9146-5915e16564f4

📥 Commits

Reviewing files that changed from the base of the PR and between e138f06 and 9fea7d6.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod

📝 Walkthrough

Walkthrough

This PR adds Go runtime memory tuning (GOMEMLIMIT=2500MiB, GOGC=50) to the tn-db service and increases container memory limits from 1.5G to 3G for kwil-postgres and tn-db. It also updates github.com/trufnetwork/kwil-db and .../core pseudo-versions in go.mod.

Changes

Cohort / File(s) Summary
Memory Configuration
compose.yaml
Added GOMEMLIMIT=2500MiB and GOGC=50 to tn-db environment; increased deploy.limits.memory from 1.5G to 3G for kwil-postgres and tn-db.
Dependency Updates
go.mod
Bumped github.com/trufnetwork/kwil-db and github.com/trufnetwork/kwil-db/core pseudo-versions to 0.20260313141718-a7f124b3e0b7.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • pr-time-tracker

Poem

🐰 I nibbled code beneath the tree,

Tuned GC and memory for safe knee,
From 1.5 to three gigs I hop,
Dependencies updated — pop! pop!
Happy node, I thump and beep.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR addresses the linked issue #1316 by adding memory tuning (GOMEMLIMIT, GOGC) and increasing container memory limits to reduce out-of-memory risks.
Out of Scope Changes check ✅ Passed All changes are within scope: compose.yaml modifications for memory tuning/limits and go.mod dependency updates align with the memory safety objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: bumping kwil-db dependencies to address OOM prevention, which aligns with both the file changes (dependency version updates) and the PR objective (reducing out-of-memory issues).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch updateGomod
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
compose.yaml (1)

62-65: Propagate memory tuning settings to dev-net environment for consistency.

The tn-db-1 and tn-db-2 services in deployments/dev-net/devnet-compose.yaml lack the GOMEMLIMIT, GOGC, and memory deploy limits present in the main compose.yaml. Adding these settings will ensure consistent memory behavior and OOM protection across development and production environments:

  • GOMEMLIMIT (set to ~80% of memory limit)
  • GOGC=50 (triggers GC at 50% heap growth)
  • deploy.resources.limits.memory
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@compose.yaml` around lines 62 - 65, The dev environment services tn-db-1 and
tn-db-2 are missing the memory tuning and limits present in the main compose;
for each of those service definitions add an environment block with GOMEMLIMIT
set to ~80% of the service memory limit (e.g., if memory: 3G then
GOMEMLIMIT=2.4G), add GOGC=50, and add deploy.resources.limits.memory with the
same value used in the main compose (e.g., 3G) so OOM protection and GC tuning
are consistent; update both tn-db-1 and tn-db-2 entries accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@compose.yaml`:
- Around line 62-65: The dev environment services tn-db-1 and tn-db-2 are
missing the memory tuning and limits present in the main compose; for each of
those service definitions add an environment block with GOMEMLIMIT set to ~80%
of the service memory limit (e.g., if memory: 3G then GOMEMLIMIT=2.4G), add
GOGC=50, and add deploy.resources.limits.memory with the same value used in the
main compose (e.g., 3G) so OOM protection and GC tuning are consistent; update
both tn-db-1 and tn-db-2 entries accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cfc6c004-a798-4672-af97-58a0834a2776

📥 Commits

Reviewing files that changed from the base of the PR and between 9b3ee99 and e138f06.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • compose.yaml
  • go.mod

@MicBun MicBun changed the title chore: bump kwil-db depedencies chore: bump kwil-db depedencies to prevent OOM crash Mar 13, 2026
@MicBun MicBun merged commit 9b98e1d into main Mar 13, 2026
6 of 7 checks passed
@MicBun MicBun deleted the updateGomod branch March 13, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem: reduce the probability of out of memory issues on node

1 participant