Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: High High
    • Resolution: Won't Fix
    • Affects Version/s: 5.4.12
    • Fix Version/s: Customer request
    • Component/s: 5.x > Legacy IO
    • Labels:
      None

      Description

      If the cache is cleared during certain high traffic scenarios there can be a race condition where if ( eZTranslationCache::canRestoreCache( $contextName, $tsTimeStamp ) ) fails as the file doesn't exists yet (it calls file_exists()). (See PR for context).

      This leads the cache load for the context to fail and the cache remains empty. This in turns causes the translation to fall back to english and calls to i18n() gets inlined in the compiled template as english instead of the original language. Should affect most versions of legacy eZ Publish.

      PR: https://github.com/ezsystems/ezpublish-legacy/pull/1388

      Steps to reproduce:

      • Set up a site access with a different language than default eng-GB. For example nor-NO.
      • Ensure a page, such as / displays one or more translated strings via i18n operator. The more the better, especially with different translation contexts as each context has its own cache file.
      • Hammer the site with traffic. I used ab -n10000 -c50 http://<site url>. A different set of parameters might be needed depending on hardware. I tried initially with -c20, but failed to reproduce. However with -c50 I was successful. A bit of trial and error is necessary.
      • While hammering the site, delete the cache directory: rm -fr var/<siteaccess>/cache.
      • Load the page, and if the bug was triggered some/all of the translations are now in English, and not in the language configured for the site access.

      Some times I could trigger the bug on first delete of the cache, other times I had to delete the cache 3-5 times before the bug was triggered. This is a race condition which is generally hard to reproduce.

        Issue Links

          Activity

          Hide
          Konrad Oboza added a comment -

          Ole Morten Halvorsen using provided steps I wasn't able to reproduce this issue. Here is what I did:
          1. I set new nor siteacces like this:

          ezpublish.yml

          nor:
               languages: [nor-NO]
                   location_view:
                       full:
                           testRuleset:
                               template: AppBundle:full:test.html.twig
                                   match:
                                       Identifier\ContentType: [testct]
                   var_dir: var/nor
          

          2. In admin panel I added norwegian language and created new Content Type.
          3. I set norwegian locale in ezpublish_legacy/settings/siteaccess/nor/site.ini.append.php like following:

          [RegionalSettings]
          Locale=nor-NO
          TextTranslation=enabled
          

          4. In my twig template I included test_render.tpl which contains some translated strings:

          test_render.tpl

          {"Are you sure you want to remove these items?"|i18n('design/standard/node')}
          {'Year'|i18n('design/ezdemo/content/datatype')}
          {'Month'|i18n('design/ezdemo/content/datatype')}
          

          5. I hammered website using similar command which you attached.
          6. During execution I cleared cache multiple times:
          rm -rf ezpublish_legacy/var/nor/cache/*
          rm -rf web/var/nor/cache/*

          I also tried clearing cache from the admin panel. Besides that, experimented with number of request which are run simultaneously, but without success. I set page to be refreshed automatically every x seconds. Could you please confirm that mentioned steps are sufficient to reproduce this issue on your side or I forgot some important setting? Do you maybe have some other configuration on your side which could be helpful?

          Thank you in advance.

          Show
          Konrad Oboza added a comment - Ole Morten Halvorsen using provided steps I wasn't able to reproduce this issue. Here is what I did: 1. I set new nor siteacces like this: ezpublish.yml nor: languages: [nor-NO] location_view: full: testRuleset: template: AppBundle:full:test.html.twig match: Identifier\ContentType: [testct] var_dir: var/nor 2. In admin panel I added norwegian language and created new Content Type. 3. I set norwegian locale in ezpublish_legacy/settings/siteaccess/nor/site.ini.append.php like following: [RegionalSettings] Locale=nor-NO TextTranslation=enabled 4. In my twig template I included test_render.tpl which contains some translated strings: test_render.tpl {"Are you sure you want to remove these items?"|i18n('design/standard/node')} {'Year'|i18n('design/ezdemo/content/datatype')} {'Month'|i18n('design/ezdemo/content/datatype')} 5. I hammered website using similar command which you attached. 6. During execution I cleared cache multiple times: rm -rf ezpublish_legacy/var/nor/cache/* rm -rf web/var/nor/cache/* I also tried clearing cache from the admin panel. Besides that, experimented with number of request which are run simultaneously, but without success. I set page to be refreshed automatically every x seconds. Could you please confirm that mentioned steps are sufficient to reproduce this issue on your side or I forgot some important setting? Do you maybe have some other configuration on your side which could be helpful? Thank you in advance.
          Hide
          André Rømcke added a comment -

          Merged PR

          Konrad Oboza I don't think you can easily reproduce this, so better to take this as a code improvement.

          Show
          André Rømcke added a comment - Merged PR Konrad Oboza I don't think you can easily reproduce this, so better to take this as a code improvement.
          Hide
          Ernesto Buenrostro added a comment -

          Hi guys,

          I have upgraded a multi-language site, this change is breaking the whole site.

          After I applied the PR change, there was a serious performance problem. The website pages were taking about 10-20 minutes to render --if the pages were rendered at all.

          Removing the PR change returned the site's regular speed.

          Show
          Ernesto Buenrostro added a comment - Hi guys, I have upgraded a multi-language site, this change is breaking the whole site. After I applied the PR change, there was a serious performance problem. The website pages were taking about 10-20 minutes to render --if the pages were rendered at all. Removing the PR change returned the site's regular speed.
          Hide
          André Rømcke added a comment - - edited

          Patch had regression on performance (in single server setup) and got reverted in https://jira.ez.no/browse/EZP-29901, re-opening this issue.

          Show
          André Rømcke added a comment - - edited Patch had regression on performance (in single server setup) and got reverted in https://jira.ez.no/browse/EZP-29901 , re-opening this issue.
          Hide
          André Rømcke added a comment -

          Closing as won't fix as eZ Publish 5.x is out of matintance, and so is legacy on eZ Platform installations. Legacy is still within service life so still supported and receives security fixes, and contributions are as before still welcome.

          https://support.ez.no/Public/Service-Life

          Show
          André Rømcke added a comment - Closing as won't fix as eZ Publish 5.x is out of matintance, and so is legacy on eZ Platform installations. Legacy is still within service life so still supported and receives security fixes, and contributions are as before still welcome. https://support.ez.no/Public/Service-Life

            People

            • Assignee:
              Unassigned
              Reporter:
              Ole Morten Halvorsen
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: