Problem/Motivation
Translation updates during cron run are executed without queue or batch operations. This results in timeout or php_max_execution time overrun.
Proposed resolution
Convert the update process to a queue driven process. It can be modeled after Drupal 8's locale update process.
Remaining tasks
t.b.d.
User interface changes
None.
API changes
t.b.d
Related Issues
#1430546: Better performance when fetching available update status
Original report by josebrito
I activated the l10n_update module on a working site and right after it I executed cron and I get this message on my status report:
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {l10n_update_file}; Array ( ) in l10n_update_get_history() (line 399 of .../sites/all/modules/l10n_update/l10n_update.module).
I have the module working fine on another site and one of the diferences is the tables prefix. Has this module any problem with table prefix settings?
Comments
Comment #1
gábor hojtsy"MySQL server has gone away" should have no relation to how this module operates, I think it was triggered by some other issue. Can you still reproduce this reliably?
Comment #2
gábor hojtsyLooks like the answer is no.
Comment #3
josebrito commentedSorry for my delay.
Is correct. I've installed drupal with localized profile and I installed a new version of the module on sites/all/modules folder.
I deleted from the profile folder, installed from sites/all/modules and is working fine.
Thanks
Comment #4
agoradesign commentedHi,
I'll reopen this issue because I'm getting exactly the same error, every time I try to visit admin/reports/status or admin/config. The page loads for a every long time and in the end some kind of timeout causes the error message above...
This problem is a real big question mark for me. First I thought that perhaps the module tries to load a language file from a remote server and has connection problems and causes a timeout, but there's no call like this on line 399, only a db query. And this query is very normal and harmless:
$result = db_query("SELECT * FROM {l10n_update_file}");I also looked at the database table. There are currently 24 records in it. All of them look normal - no duplicates, nothing suspicious there.
As soon as I disable the l10n module, everything works perfectly. As soon as I enable it, the problem reappears.
Further important infos:
Especially the last info, that it is reproducible, but only for a certain amount of time, brings me to the idea, that maybe a bad record in a cache table may be the cause?!
When I look at the 'cache' table, I see a record with cid 'l10n_update_server:http://localize.drupal.org/l10n_server.xml' . I tried to delete that record, but the error still remains...
Comment #5
julien04 commentedSame problem since 09/22/2011
Comment #6
mareks commentedHad same problem. Got rid of it after disabling "Localization update" module.
Comment #7
epawel commentedThe same problem - when I disabled the l10n module everything works fine.
Comment #8
sutharsan commentedIn my experience the "MySQL server has gone away" error is a combination of slow sever, minimal database settings, many modules and heavy task. Many of these are beyond our control as module maintainer. Probably the only thing we can do is to cut down the download and import task into smaller portions. That's why we should postpone this issue until #569004: Add support for seek based batch import of .po files is fixed.
Comment #9
Nightwalker3000 commentedSame issue here, since 3 Days i get this message. It really looks like its a server issue. I've mirrored my site on my developing machine and here it works. I've tried to increase some PHP limits on my server
php_value mysql.connect_timeout 1800
php_value max_execution_time 1800
php_value default_socket_timeout 1800
but this doesnt help.
Maybe its a good workaround, if there exists some options to select which Modules should be automaticaly updated. Unfortunately i'm not familiar enough with Drupal to submit a patch.
Comment #10
casey commentedThis happens if you got plenty of modules to check.
l10n_update_requirements() calls l10n_update_available_releases() which always calls l10n_update_check_projects() if cache for cache_get('l10n_update_available_releases') is not built, no matter what $frequency is set to.
l10n_update_check_projects() is quite heavy for multiple projects. A temporary fix is increasing the execution time limit during this checking process. Note this process is only invoked if there is no cache yet.
l10n_update.check.inc
Comment #11
casey commentedA real fix would be following the same procedure as Update module from core; reporting that no update information is available and refactoring l10n_update_check_projects() into a batch.
Comment #12
sutharsan commentedYou are right, we don't do temporary fixes ;) I was working myself through the same part of code while working on issue: #1347440: l10n_update_requirements() in manual mode
At first
l10n_update_check_projects()should respect the manual/frequency setting. Next need to check if recently collected states can be re-used and lastly we should use batch api where possible. But the same function must be usable in both cron and UI conditions.Comment #13
sutharsan commentedRewriting the status update process to a batch process turns out to be a major operation. For now I will postpone this issue until we see the results of #1347440: l10n_update_requirements() in manual mode. This should result in a less frequent use of the update status process.
@casey, can you help on this conversion to a batch process?
Comment #14
sutharsan commentedThe introduction of a batch process for status check takes place here: #1430546: Better performance when fetching available update status
Comment #15
casey commentedI am really sorry but I currently just have no time.
Comment #16
cesareaugusto commentedHi all! I ran into the very same problem! Pointing to /admin/reports/status I wait for long then I get this error
Same on /admin/config/regional/translate/update:
Comment #17
jawi commentedsame issue here
Comment #18
valery86 commentedSubscribing.
Does anyone know any workaround?
Comment #19
Anonymous (not verified) commentedGetting this exact problem today, March 30, 2013. Is there any solution available? This is a critical error that makes it impossible for non-drush users to perform basic site tasks such as rebuilding permissions or even running cron.
Comment #20
Anonymous (not verified) commentedDisabling the Localization Update module allowed me to access Status Report and perform Cron.
Comment #21
sutharsan commented@trainingcity, no there is no solution unless someone is working on it.
Back to postponed.
Comment #22
iadegesso commentedThis seem to be a workaround for the localization/mysql issue
https://drupal.org/node/259580#comment-1511512
Comment #22.0
iadegesso commentedUpdated issue summary.
Comment #23
sutharsan commentedNo further development on 7.x-1.x branch will take place for this issue. 7.x-2.x branch has an improved cron handling.