Skip to content

fix: prevent exception handlers from restarting FrankenPHP workers - #10721

Open
michalsn wants to merge 2 commits into
codeigniter4:developfrom
michalsn:fix/worker-mode-exceptions
Open

michalsn wants to merge 2 commits into
codeigniter4:developfrom
michalsn:fix/worker-mode-exceptions

Conversation

@michalsn

@michalsn michalsn commented Nov 4, 2026

Copy link
Copy Markdown
Member

Description
This PR fixes a bug where exception handlers called exit() after rendering errors, causing FrankenPHP workers to restart even for 404 responses without a custom override.

The handlers now return to the worker loop so request cleanup can run. Retained exception, request, and response state is cleared before the next request. Traditional execution keeps its existing exit behavior.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 4, 2026

@paulbalandan paulbalandan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Just a nit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants