Get search indexed
Out of memory error
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!
Labels |
Added:
?
|
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.
Category | ⇒ | SQL |
Status | New | ⇒ | Information Required |
@mbabker close this Issue?
If this Issue get no Response, it will be closed at 22th October 2017.
This has been closed due to lack of response to the requests above – it can always be reopened.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-10-22 05:31:49 |
Closed_By | ⇒ | franz-wohlkoenig |
Closed_By | franz-wohlkoenig | ⇒ | joomla-cms-bot |
Set to "closed" on behalf of @franz-wohlkoenig by The JTracker Application at issues.joomla.org/joomla-cms/17159
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.