Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22146

roles applied to many users cause fatal errors

    Details

    • Sprint:
      Ventoux Sprint 4, Ventoux Sprint 5

      Description

      This case only happens on massive roles.
      if a role is applied to many users(order of thousands and up) and/or has many limitations per user, when the role needs updating, generating the new cache for the role can take a long time and consume all available memory.

      a good evaluation of this limit is opening the role in the admin interface. a role can take minutes to display and eventually the page stops responding.

        Issue Links

          Activity

          Hide
          Seiji Okamoto added a comment -

          A pull request for a patch has been created here: https://github.com/ezsystems/ezpublish-kernel/pull/707

          Show
          Seiji Okamoto added a comment - A pull request for a patch has been created here: https://github.com/ezsystems/ezpublish-kernel/pull/707
          Show
          Petar Spanja (Inactive) added a comment - Pull request: https://github.com/ezsystems/ezpublish-kernel/pull/717
          Show
          Petar Spanja (Inactive) added a comment - Fixed in ezpublish-kernel/master: https://github.com/ezsystems/ezpublish-kernel/commit/6fec55834823c12a52d6cb9a7cffa65568f0591e
          Hide
          Marcos Loureiro (Inactive) added a comment - - edited

          I'm still having fatal error (on 5.2 the other versions are still being tested).

          PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/EzcDatabase.php on line 189
          PHP Stack trace:
          PHP   1. {main}() /var/www/html/ezp52/ezpublish/console:0
          PHP   2. Symfony\Component\Console\Application->run() /var/www/html/ezp52/ezpublish/console:27
          PHP   3. eZ\Bundle\EzPublishCoreBundle\Console\Application->doRun() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121
          PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php:41
          PHP   5. Symfony\Component\Console\Application->doRun() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96
          PHP   6. Symfony\Component\Console\Application->doRunCommand() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191
          PHP   7. Symfony\Component\Console\Command\Command->run() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904
          PHP   8. EzSystems\TestSystemBundle\Command\Issues\Ezp22146Command->execute() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244
          PHP   9. eZ\Publish\Core\SignalSlot\RoleService->loadRoleByIdentifier() /var/www/html/ezp52/src/EzSystems/TestSystemBundle/Command/Issues/Ezp22146Command.php:49
          PHP  10. eZ\Publish\Core\Repository\RoleService->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/RoleService.php:223
          PHP  11. eZ\Publish\Core\Persistence\Cache\UserHandler->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/RoleService.php:419
          PHP  12. eZ\Publish\Core\Persistence\Legacy\User\Handler->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/UserHandler.php:133
          PHP  13. eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\EzcDatabase->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Handler.php:228
          PHP  14. PDOStatement->fetchAll() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/EzcDatabase.php:189
          

          However not sure if this is the expected since I'm using 128mb memory on php, and 2000+ users/groups assigned to role.
          if I use the -d memory_limit=-1 it does work

          Show
          Marcos Loureiro (Inactive) added a comment - - edited I'm still having fatal error (on 5.2 the other versions are still being tested). PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/EzcDatabase.php on line 189 PHP Stack trace: PHP 1. {main}() /var/www/html/ezp52/ezpublish/console:0 PHP 2. Symfony\Component\Console\Application->run() /var/www/html/ezp52/ezpublish/console:27 PHP 3. eZ\Bundle\EzPublishCoreBundle\Console\Application->doRun() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:121 PHP 4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php:41 PHP 5. Symfony\Component\Console\Application->doRun() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:96 PHP 6. Symfony\Component\Console\Application->doRunCommand() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:191 PHP 7. Symfony\Component\Console\Command\Command->run() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:904 PHP 8. EzSystems\TestSystemBundle\Command\Issues\Ezp22146Command->execute() /var/www/html/ezp52/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:244 PHP 9. eZ\Publish\Core\SignalSlot\RoleService->loadRoleByIdentifier() /var/www/html/ezp52/src/EzSystems/TestSystemBundle/Command/Issues/Ezp22146Command.php:49 PHP 10. eZ\Publish\Core\Repository\RoleService->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/RoleService.php:223 PHP 11. eZ\Publish\Core\Persistence\Cache\UserHandler->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/RoleService.php:419 PHP 12. eZ\Publish\Core\Persistence\Legacy\User\Handler->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Cache/UserHandler.php:133 PHP 13. eZ\Publish\Core\Persistence\Legacy\User\Role\Gateway\EzcDatabase->loadRoleByIdentifier() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Handler.php:228 PHP 14. PDOStatement->fetchAll() /var/www/html/ezp52/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/User/Role/Gateway/EzcDatabase.php:189 However not sure if this is the expected since I'm using 128mb memory on php, and 2000+ users/groups assigned to role. if I use the -d memory_limit=-1 it does work
          Hide
          Petar Spanja (Inactive) added a comment -

          @Marcos Loureiro

          Found the problem, join causing excessive memory usage was not removed for loadByIdentifier method.
          Fixed in ezpublish-kernel/master: https://github.com/ezsystems/ezpublish-kernel/commit/b9e0b73d9bf773203356ff4b9760c9eb8a312043

          Other fixes coming shortly.

          Show
          Petar Spanja (Inactive) added a comment - @ Marcos Loureiro Found the problem, join causing excessive memory usage was not removed for loadByIdentifier method. Fixed in ezpublish-kernel/master: https://github.com/ezsystems/ezpublish-kernel/commit/b9e0b73d9bf773203356ff4b9760c9eb8a312043 Other fixes coming shortly.
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Paulo Bras (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 5 hours, 45 minutes
                2d 5h 45m

                  Agile