Mass action timing out

  • Posts: 199
  • Thank you received: 16
  • Hikashop Business
8 hours 12 minutes ago #370750

-- 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

Attachments:
Last edit: 7 hours 14 minutes 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.

  • Posts: 85238
  • Thank you received: 13914
  • MODERATOR
2 hours 18 minutes ago #370751

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.

Last edit: 2 hours 17 minutes ago by nicolas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum