mirror of
https://github.com/gotempsh/temps.git
synced 2026-04-24 22:06:00 +03:00
[PR #13] [MERGED] fix(core): lifecycle management, bounded caches, and memory safety across 11 crates #17
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/temps#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/gotempsh/temps/pull/13
Author: @dviejokfs
Created: 2/19/2026
Status: ✅ Merged
Merged: 2/25/2026
Merged by: @dviejokfs
Base:
main← Head:feat/postgres-backup-sidecar📝 Commits (10+)
3bb96e9feat(providers,backup,core): pg_dump sidecar backup, preset registry, and error hardening4b5616dfix(core): lifecycle management, bounded caches, and memory safety across 11 cratesc6dd56ffix(environments): remove useless .into() conversions on chrono::Utc::now() in tests6cad3cdfix(backup): switch pg_dump to plain format to fix OOM and add error logging92c0041refactor(backup): update backup file extensions and improve sidecar memory management023a5ebrefactor(backup): enhance backup process with direct file writing and improved error handlinge5b82c2fix(backup): extend command duration for backup sidecar to prevent OOM issuesa15552drefactor(backup): update backup container configuration for improved access and clarity9ea5e80refactor(backup): optimize pg_dump execution to prevent memory issues8ec782bchore: update Docker configurations and backup service enhancements📊 Changes
79 files changed (+9783 additions, -2449 deletions)
View changed files
📝
.gitignore(+2 -0)📝
CHANGELOG.md(+9 -0)📝
Cargo.lock(+2 -0)📝
Cargo.toml(+3 -0)📝
apps/temps-cli/src/commands/errors/index.ts(+334 -3)📝
crates/temps-analytics-events/Cargo.toml(+2 -0)📝
crates/temps-analytics-events/src/handlers/events_handler.rs(+747 -3)📝
crates/temps-analytics-events/src/plugin.rs(+2 -0)📝
crates/temps-analytics-events/src/types/requests.rs(+36 -0)📝
crates/temps-analytics-funnels/src/services/service.rs(+243 -1)📝
crates/temps-analytics-performance/src/services/service.rs(+374 -193)📝
crates/temps-analytics-session-replay/src/services/service.rs(+10 -10)📝
crates/temps-audit/src/services/audit_service.rs(+2 -3)📝
crates/temps-backup/src/handlers/backup_handler.rs(+34 -46)📝
crates/temps-backup/src/services/backup.rs(+1772 -309)📝
crates/temps-cli/src/commands/backup.rs(+24 -3)📝
crates/temps-core/src/plugin.rs(+49 -53)📝
crates/temps-core/templates.yaml(+28 -0)📝
crates/temps-deployer/src/docker.rs(+35 -10)📝
crates/temps-deployments/src/handlers/deployments.rs(+15 -3)...and 59 more files
📄 Description
Summary
Comprehensive memory safety, lifecycle management, and performance improvements across 11 crates. Fixes OOM risks, resource leaks, unbounded caches, and adds proper shutdown/cleanup semantics to long-running background tasks.
Changes
Backup & Data Safety
Memory & Performance Fixes
percentile_cont()— Replaces in-memory percentile sorting in analytics-performanceselect_only()for source maps — Avoids fetching blob content when listing source mapsLIMIT+ bulkUPDATEon large replay queriesLazyLockregexes — Error tracking regexes compiled once instead of per-requestLifecycle & Resource Management (6 fixes)
temps-notifications) —new()returns plainSelfinstead ofArc<Self>, addedstart()/shutdown()methods +Dropfor clean cancellationtemps-routes) — StoresJoinHandleinMutex, addedshutdown()+Drop. Spawned task captures onlyArc<CachedPeerTable>instead ofArc<Self>temps-routes) — Changedstart_listeningfrom consumingselfto&self, spawns internal task with storedJoinHandle+Droptemps-analytics-funnels) — Addedmax_capacity(default 1000). Evicts expired entries first, then oldest-by-expiration on overflowtemps-monitoring) —scan_monitors()now prunes entries for monitors no longer in the active DB settemps-webhooks) — AddedDropimpl usingtry_write()to abort spawned task handleOther Improvements
temps errors sourcemaps upload/list/deleteTesting
28 new tests covering lifecycle, bounded cache, and cleanup behavior:
Crates Modified (30 files)
temps-backup,temps-deployer,temps-deployments,temps-environments,temps-error-tracking,temps-analytics-events,temps-analytics-funnels,temps-analytics-performance,temps-analytics-session-replay,temps-monitoring,temps-notifications,temps-routes,temps-webhooks,temps-projects,temps-status-page,temps-cli🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.