Merged
Conversation
drdzyk
previously approved these changes
Sep 4, 2023
8a048cd to
68c09a3
Compare
drdzyk
approved these changes
Sep 11, 2023
DrDet
added a commit
that referenced
this pull request
Nov 7, 2023
- don't fetch net events right before script termination (relates to #893) - added total allocation metrics: `kphp_memory_script_allocated_total`, `kphp_memory_script_allocations_count` - removed maximum script timeout limit - make `disable-sql` option deprecated and turned on unless SQL port is given
astrophysik
pushed a commit
that referenced
this pull request
Nov 9, 2023
- don't fetch net events right before script termination (relates to #893) - added total allocation metrics: `kphp_memory_script_allocated_total`, `kphp_memory_script_allocations_count` - removed maximum script timeout limit - make `disable-sql` option deprecated and turned on unless SQL port is given
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Sometimes
SIGSEGVis raised on production fromcurl_epoll_cbon accessing data from script memory.Reason
curl_epoll_cbruns after script termination, when script memory is already freed, despite the relatedfdis removed from epoll on script termination.It happens because sometimes epoll callbacks can be invoked after the related 'fd' is removed from epoll. Our net_reactor at first stores epoll events from
epoll_wait, and only then runs the related callbacks (seeepoll_fetch_events()), and sometimes it happens that between events fetching and processing script termination is happened.Usually this situation is handled via some additional connection flags (
conn_expect_query,C_WANTRDetc.) in callbacks likeserver_read_write_gatewayand related. But incurl_epoll_cbwe try to keep it simple and not to do all of this stuff.Fixes
curl_epoll_cbthatfdis still present in epoll reactorAnd more general fix is in the separate PR #897: don't fetch net events right before script termination
relates to
KPHP-1578