Skip to content

Fix frankenphp shutdown functions - #65563

Merged
CarlSchwan merged 4 commits into
masterfrom
fix/fix-frankenphp-shutdown-functions
Oct 27, 2026
Merged

CarlSchwan merged 4 commits into
masterfrom
fix/fix-frankenphp-shutdown-functions

Conversation

@come-nc

@come-nc come-nc commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor
  • Resolves: #

Summary

This is an attempt at fixing the service leak currently happening when using frankenphp worker mode.
At some point database connection pool is exhausted because services from previous requests are not garbage collected.
This removes one of the references that were kept against some services: shutdown functions.
It does not fix the issue yet, so there must be other sources of references to container or services outside of the request lifecycle.
This also keeps the Server object around and only rebuilds the internal containers.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@come-nc come-nc added this to the Nextcloud 36 milestone Oct 15, 2026
@come-nc come-nc self-assigned this Oct 15, 2026
@come-nc come-nc added the 2. developing Work in progress label Oct 15, 2026
Only the container and app containers are dropped, the server object
 itself is kept. That will allow to keep global state in the Server
 object if needed, and later to keep or revive some services.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Make sure to reset exception and error handler, and register shutdown
 functions through Server instance. For TempManager, rely on destructor
 instead. This helps reducing the number of service references floating
 around. There’s still something keeping database connections alive
 unidentified yet.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Default is too low.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-nc force-pushed the fix/fix-frankenphp-shutdown-functions branch from c5f007e to dd34b4d Compare October 27, 2026 08:36
@come-nc
come-nc marked this pull request as ready for review October 27, 2026 09:09
@come-nc
come-nc requested a review from a team as a code owner October 27, 2026 09:09
@come-nc
come-nc requested review from Altahrim, icewind1991, provokateurin and sorbaugh and removed request for a team October 27, 2026 09:09
@come-nc come-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 27, 2026
@come-nc
come-nc requested a review from CarlSchwan October 27, 2026 09:09
@CarlSchwan
CarlSchwan merged commit 9bd4cd4 into master Oct 27, 2026
209 of 215 checks passed
@CarlSchwan
CarlSchwan deleted the fix/fix-frankenphp-shutdown-functions branch October 27, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants