Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix broken request stack state if throwable is thrown. #47358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

Warxcell
Copy link
Contributor

@Warxcell Warxcell commented Aug 22, 2022

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

When using long-running server (like roadrunner) if Throwable is thrown - requestStack is never pop out and it stays in broken state and next requests receive previous request object.

@Warxcell Warxcell requested a review from dunglas as a code owner August 22, 2022 14:59
@carsonbot carsonbot added this to the 6.2 milestone Aug 22, 2022
@Warxcell Warxcell force-pushed the fix_stale_request_stack branch from 39674e0 to f55c39d Compare August 22, 2022 15:01
@Warxcell Warxcell changed the title Fix stale request stack Fix broken request stack state if throwable is thrown. Aug 22, 2022
@Warxcell Warxcell changed the base branch from 6.2 to 4.4 August 22, 2022 15:01
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

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

Makes sense to me. Can you add some tests?

@Warxcell
Copy link
Contributor Author

Added tests, tho I'm not quite sure what's the best way to throw Throwable.

@Warxcell Warxcell force-pushed the fix_stale_request_stack branch from b1a7414 to eb4b5aa Compare August 22, 2022 15:19
src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php Outdated Show resolved Hide resolved
@Warxcell Warxcell force-pushed the fix_stale_request_stack branch 2 times, most recently from 4a3802a to 9512ce0 Compare August 22, 2022 15:21
@stof
Copy link
Member

stof commented Aug 22, 2022

Instead of a test requiring a file with a syntax error, it would be simpler to make a function trigger a Error here.

@Warxcell Warxcell force-pushed the fix_stale_request_stack branch from 9512ce0 to e5c4190 Compare August 22, 2022 15:29
@Warxcell
Copy link
Contributor Author

Error

Ah yes, totally forgot about it. Thanks!

src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php Outdated Show resolved Hide resolved
@Warxcell Warxcell force-pushed the fix_stale_request_stack branch from e5c4190 to e35d6ba Compare August 22, 2022 16:35
@fabpot
Copy link
Member

fabpot commented Aug 23, 2022

Thank you @Warxcell.

@fabpot fabpot merged commit 17a8daf into symfony:4.4 Aug 23, 2022
@fabpot fabpot mentioned this pull request Sep 30, 2022
nicolas-grekas added a commit that referenced this pull request Oct 18, 2022
… exception (krzyc)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix empty request stack when terminating with exception

| Q             | A
| ------------- | ---
| Branch?       | 4.4, 5.4, 6.0, 6.1, 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #47577
| License       | MIT
| Doc PR        |

After #47358 the RequestStack is empty when request terminates with exception, which prevents SecurityDataCollector to generate logout URL and generates fatal error.

Commits
-------

e4d6e7b [HttpKernel] Fix empty request stack when terminating with exception
symfony-splitter pushed a commit to symfony/http-kernel that referenced this pull request Oct 18, 2022
… exception (krzyc)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix empty request stack when terminating with exception

| Q             | A
| ------------- | ---
| Branch?       | 4.4, 5.4, 6.0, 6.1, 6.2
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #47577
| License       | MIT
| Doc PR        |

After symfony/symfony#47358 the RequestStack is empty when request terminates with exception, which prevents SecurityDataCollector to generate logout URL and generates fatal error.

Commits
-------

e4d6e7b4ba [HttpKernel] Fix empty request stack when terminating with exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.