?
avatar nwheele3
nwheele3
17 Jul 2017

Steps to reproduce the issue

  1. Ensure (mysql) database has a low max_allowed_packet setting
  2. Create content with a huge body
  3. Run cli/finder_indexer.php on the CLI

Expected result

Get search indexed

Actual result

Out of memory error

Additional comments

This presents as a memory error, so I used xdebug to determine what was going on. xdebug made it seem like a recursive error, which is what lead to the memory error. I added a simple print statement to line 630 in /libraries/joomla/database/driver/mysqli.php to echo the error it captures. This code merely captures ALL database errors, and if it can reconnect it just...eats the error and continues, which results in infinitely trying the same thing over and over again, and runs into the same error an infinite amount of times. The fix is probably to propagate the error up and out, instead of eating it silently (which results in the above symptoms). If you read the commented code in mysqli.php, you can see the obvious logic error which results in this condition.

I am running an old version, but I compared the code with what is currently in the staging branch and it reads the same.

Let me know if you need more information! Thanks!

avatar nwheele3 nwheele3 - open - 17 Jul 2017
avatar joomla-cms-bot joomla-cms-bot - change - 17 Jul 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 17 Jul 2017
avatar mbabker
mbabker - comment - 17 Jul 2017

The fix is probably to propagate the error up and out, instead of eating it silently (which results in the above symptoms)

That'd actually break a purposefully designed feature. The logic is if the query fails and at that point the site is disconnected from the database server, it attempts to reconnect and replay the query if the connection can be re-established. From the sounds of it, you're hitting a scenario where the query fails and the connection closes at the same time (the aforementioned memory error) but the driver is able to reconnect so it tries again. At best, the fix here would be a reconnect counter logic where we only let it replay itself X times before giving up.

avatar nwheele3
nwheele3 - comment - 18 Jul 2017

You're right, I was reading the code wrong. This error is hit because the error is simultaneous with the database connection being closed. Although not due to memory (that's only after this happens many times). Perhaps mysql closes the connection once it hits the max allowable packet #.

In fact, that is one of the few conditions where this bug could be activated:

https://dev.mysql.com/doc/refman/5.7/en/error-lost-connection.html

Not sure how the best way to handle that is, as hard-coding a specific error condition seems wrong to me. A counter followed by reporting original error message after three attempts seems like a reasonable solution.

avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Jul 2017
Category SQL
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Jul 2017
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 26 Aug 2017

@mbabker close this Issue?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17159.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Sep 2017

If this Issue get no Response, it will be closed at 22th October 2017.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 22 Oct 2017

This has been closed due to lack of response to the requests above – it can always be reopened.

avatar franz-wohlkoenig franz-wohlkoenig - change - 22 Oct 2017
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-10-22 05:31:49
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 22 Oct 2017
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 22 Oct 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 22 Oct 2017

Add a Comment

Login with GitHub to post a comment