- Posts: 203
- Thank you received: 16
Mass action timing out
- smithshop123
-
Topic Author
- Offline
Less
More
6 months 2 weeks ago - 6 months 2 weeks ago #370750
by smithshop123
Mass action timing out was created by smithshop123
-- HikaShop version -- : 6.3.0
-- Joomla version -- : 6.0.3
-- PHP version -- : 8.3.30
-- Browser(s) name and version -- : Opera One(version: 112.0.5197.30)
-- Error-message(debug-mod must be tuned on) -- : An error has occurred.
3699 Timeout exceeded in regular expression match.
Hi,
we're running a simple regex to find a short string in our product description and add 'True'/'False' to a custom field (see attached). We need this to filter out certain products before submitting our product list to google. This has always worked in the past and no major changes have been made to the site (php version was updated recently). It has an 8000 upper limit but we have tested '1000' as an upper limit with the same result (below). Further, the timeout happens very quickly. Any suggestion on how to investigate or fix this.
An error has occurred.
3699 Timeout exceeded in regular expression match.
Thanks,
Ian and Stu
-- Joomla version -- : 6.0.3
-- PHP version -- : 8.3.30
-- Browser(s) name and version -- : Opera One(version: 112.0.5197.30)
-- Error-message(debug-mod must be tuned on) -- : An error has occurred.
3699 Timeout exceeded in regular expression match.
Hi,
we're running a simple regex to find a short string in our product description and add 'True'/'False' to a custom field (see attached). We need this to filter out certain products before submitting our product list to google. This has always worked in the past and no major changes have been made to the site (php version was updated recently). It has an 8000 upper limit but we have tested '1000' as an upper limit with the same result (below). Further, the timeout happens very quickly. Any suggestion on how to investigate or fix this.
An error has occurred.
3699 Timeout exceeded in regular expression match.
Thanks,
Ian and Stu
Last edit: 6 months 2 weeks ago by smithshop123. Reason: The service provide did something to trigger a timeout. So we used a search command that didn't require regex and it worked.
Please Log in or Create an account to join the conversation.
6 months 2 weeks ago - 6 months 2 weeks ago #370751
by nicolas
Replied by nicolas on topic Mass action timing out
Hi,
The issue comes from your regex pattern .*s3.*. In MySQL, REGEXP already matches anywhere in the string, so the .* on both sides is redundant. It forces the regex engine to consume the entire description text and then backtrack through it, which on long HTML descriptions triggers MySQL's regex timeout. That's why changing the limitation from 8000 to 1000 didn't help because the timeout happens on individual product descriptions, not on the total number of products processed.
Your workaround of switching to a non-regex search method was the right call. The CONTAINS operator translates to a SQL LIKE query which is much more efficient for simple text searches like this.
If you ever need REGEXP specifically, just use s3 as the pattern instead of .*s3.*
It does the same thing without the backtracking issue.
The issue comes from your regex pattern .*s3.*. In MySQL, REGEXP already matches anywhere in the string, so the .* on both sides is redundant. It forces the regex engine to consume the entire description text and then backtrack through it, which on long HTML descriptions triggers MySQL's regex timeout. That's why changing the limitation from 8000 to 1000 didn't help because the timeout happens on individual product descriptions, not on the total number of products processed.
Your workaround of switching to a non-regex search method was the right call. The CONTAINS operator translates to a SQL LIKE query which is much more efficient for simple text searches like this.
If you ever need REGEXP specifically, just use s3 as the pattern instead of .*s3.*
It does the same thing without the backtracking issue.
Last edit: 6 months 2 weeks ago by nicolas.
Please Log in or Create an account to join the conversation.
Time to create page: 0.202 seconds