CP-17204 connection lost#17208
Merged
Merged
Conversation
5.14.2 Release
The :params placeholder and the built-in default MVC/CLI routes compiled to the nested quantifier (/.*)*, whose overlapping body backtracks catastrophically when the trailing anchor cannot match. Because Router::handle() runs the pattern against the request URI on every request, a short crafted URI drove preg_match() into exponential time. Compile the trailing group to the equivalent (/.*)? instead. It accepts the same language and captures the same params value, so routing behaviour is unchanged while the nested quantifier is removed. Updated the affected compiled-pattern tests and added a regression test.
Assisted-by: Claude Code
Assisted-by: Claude Code
Prep 5.15.0
Fix router params redos
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
Assisted-by: Claude Code
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.
Hello!
In raising this pull request, I confirm the following:
Added connection-liveness and opt-in auto-reconnect support to
Phalcon\Db\Adapter\Pdo\AbstractPdo:ping()(aSELECT 1probe),ensureConnection()(reconnect in place when the probe fails), andsetAutoReconnect()/getAutoReconnect()(also settable via theautoReconnectdescriptor key). When auto-reconnect is enabled and a query fails on a lost ("gone away") connection outside a transaction,execute()andquery()fire the newdb:connectionLostevent, reconnect, and retry the statement once; a loss inside a transaction is re-thrown without retry. "Gone away" detection is provided per driver byPhalcon\Db\Adapter\Pdo\Mysql(error codes 2006/2013) andPhalcon\Db\Adapter\Pdo\Postgresql(SQLSTATE 08003/08006/57P01-03), with a message fallback.Added the same liveness and opt-in auto-reconnect support to
Phalcon\DataMapper\Pdo\Connection(ping(),ensureConnection(),setAutoReconnect()/getAutoReconnect()), wrappingexec(),perform(),prepare(), andquery()with the single-retry behavior. This connection has no events manager, so nodb:connectionLostevent is fired; "gone away" detection is driver-agnostic and the in-transaction guard uses a locally tracked transaction level.Thanks