1. 22 May, 2025 2 commits
  2. 17 Feb, 2025 2 commits
  3. 11 Feb, 2025 1 commit
  4. 10 Feb, 2025 6 commits
  5. 22 Jan, 2025 3 commits
  6. 20 Jan, 2025 1 commit
    • Janka Uryga's avatar
      fix: don't memory-leak promises passed to `waitUntil` (#75041) · 20f5a79c
      Janka Uryga authored
      ### Overview
      
      `next start` stores pending promises passed to `waitUntil` so that we
      can await them before a (graceful) server shutdown and avoid
      interrupting work that's still running.
      The problem here was that this set lives a long time (the whole lifetime
      of the server), but we weren't removing resolved promises from this set,
      so we'd end up holding onto them forever and leaking memory.
      
      This bug would be triggered by any code using `waitUntil` in `next
      start` (notably, a recent change:
      https://github.com/vercel/next.js/pull/74164)
      
      ### Details 
      The bug here is that `AwaiterMulti` would hold onto resolved promises
      indefinitely. `AwaiterMulti` ends up being used by
      `NextNodeServer.getInternalWaitUntil`, which is what provides
      `waitUntil` in `next start`.
      
      The code was already attempting to clean up promises to avoid leaks. But
      the problem was that we weren't adding `promise` to `this.promises`, we
      were adding `promise.then(...)` which is a completely different object.
      So the `this.promises.delete(promise)` that `cleanup` did was
      effectively doing nothing, and `this.promises` would keep growing.
      20f5a79c
  7. 17 Jan, 2025 10 commits
  8. 07 Jan, 2025 8 commits
  9. 26 Dec, 2024 1 commit
  10. 24 Dec, 2024 2 commits
  11. 19 Dec, 2024 2 commits
  12. 17 Dec, 2024 2 commits