Skip to content

Separate SAPI deactivating and destroying resources #8876

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

Closed
wants to merge 1 commit into from

Conversation

bukka
Copy link
Member

@bukka bukka commented Jun 26, 2022

Currently some SAPI might bail out on deactivation. One of those SAPI is PHP-FPM that can bail out on request end if for example the connection is closed by the client (web sever). The problem is that in such case the resources are not freed and some values reset. The most visible impact can have not resetting the PG(headers_sent) which can cause erorrs in the next request. One such issue is described in #77780 bug which this PR fixes. It seems reasonable to separate deactivation and destroying the resource which means that the bail out will not impact it.

This targets master only for now as it changes in some way SAPI API so if there is some external SAPI, it could potentially cause issue there if it calls sapi_deactivate like some other SAPIs. To fix #77780 bug in lower branches, we can potentially also ignore ECONNABORTED but not sure if it's worth the effort if this gets to master. I plan to look to the test for #77780 a bit later as it's slightly tricky but should be added too.

Currently some SAPI might bail out on deactivation. One of those SAPI
is PHP-FPM that can bail out on request end if for example the
connection is closed by the client (web sever). The problem is that in
such case the resources are not freed and some values reset. The most
visible impact can have not resetting the PG(headers_sent) which can
cause erorrs in the next request. One such issue is described in #77780
bug. It seems reasonable to separate deactivation and destroying the
resource which means that the bail out will not impact it.
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM but needs an UPGRADIN.INTERNALS entry

@bukka
Copy link
Member Author

bukka commented Jun 26, 2022

I'm going to close this in favor of #8877 as it's backportable and a bit safer (not require changes in other SAPI's).

@bukka bukka closed this Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants