fix(performance): resolve OOM errors on the homepage#49
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…r ^7.11.0 (#7) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
The `conn` struct was inadvertently captured by asynchronous assignments within the `PageController` logic, primarily for the event teasers and previously for alerts. With alerts being fetched synchronously by the plug, and async assignment for other tasks, the large `conn` size was causing memory bloat and OOMs. This commit pulls `date` out before the closure, and makes `banner` and other synchronous assignments explicitly use `assign` rather than `async_assign_default`. Co-authored-by: paulswartz <214921+paulswartz@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
@jules rebase onto latest main |
This fixes an Out Of Memory (OOM) error that occurs when the homepage is under heavy load. The issue happens because the large conn struct (bloated by plug(:alerts) at the top of the file) was being captured in closures provided to async_assign_default. In this patch: - Explicit assignments that run synchronously (banner, fares, promoted, and remainder) have been switched to assign instead of async_assign_default. - The async assignment closure for event_teasers no longer captures conn.assigns.date, relying instead on a variable pulled out synchronously before the pipeline starts. - Redundant alert assignment (async_assign_default(:alerts, ...) in index/2) has been removed, as the plug(:alerts) performs exactly this duty. Also includes upgrading asdf-vm/actions/install to v3 to resolve CI error. Co-authored-by: paulswartz <214921+paulswartz@users.noreply.github.com>
This fixes an Out Of Memory (OOM) error that occurs when the homepage is under heavy load. The issue happens because the large
connstruct (bloated byplug(:alerts)at the top of the file) was being captured in closures provided toasync_assign_default.In this patch:
banner,fares,promoted, andremainder) have been switched toassigninstead ofasync_assign_default.event_teasersno longer capturesconn.assigns.date, relying instead on a variable pulled out synchronously before the pipeline starts.async_assign_default(:alerts, ...)inindex/2) has been removed, as theplug(:alerts)performs exactly this duty.PR created automatically by Jules for task 18263362913045023417 started by @paulswartz