Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2613

Proxy generation in multiprocess environment

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      \Doctrine\ORM\Proxy\ProxyFactory::_generateProxyClass fails to rename temporary proxy files when proxies are generated on demand in multiprocess environment using Process Control extension under Linux (http://www.php.net/manual/en/book.pcntl.php). 'Message: rename(../cache/Proxy/Dlayer/__CG__DlayerEntityInventory.php.520d1708631ed2.21378588,/../cache/Proxy/Dlayer/__CG__DlayerEntityInventory.php): No such file or directory' message is given.

      • It seems that when two parallel processes are trying to generate a proxy for the same entity, the uniqid function does not create unique temporary file names per process.
      • Also the check should be made at the time of renaming to make sure that the proxy with the same name was not already created in a parallel process.

        Activity

        Hide
        Marco Pivetta added a comment -

        The "dev" settings are not meant to be used for high concurrency environments at the moment.

        Show
        Marco Pivetta added a comment - The "dev" settings are not meant to be used for high concurrency environments at the moment.
        Hide
        Marco Pivetta added a comment -

        Duplicate of DDC-2210

        Show
        Marco Pivetta added a comment - Duplicate of DDC-2210
        Hide
        Oleg Namaka added a comment -

        Thats why you shouldn't generate proxies at runtime. The problem happens on windows, because the atomic rename operation doesn't work as perfectly there as on linux. (http://www.doctrine-project.org/jira/browse/DDC-2210?focusedCommentId=19171&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-19171)

        • In my case that is observed on a Linux machine. If the rename operation is atomic then why it still happens? As I indicated in the description it's because of the way uniqid function works.
        • Is there a plan to merge the PR from http://www.doctrine-project.org/jira/browse/DDC-2210 in a near future? The fix in it would eliminate my issue whatsoever.
        Show
        Oleg Namaka added a comment - Thats why you shouldn't generate proxies at runtime. The problem happens on windows, because the atomic rename operation doesn't work as perfectly there as on linux. ( http://www.doctrine-project.org/jira/browse/DDC-2210?focusedCommentId=19171&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-19171 ) In my case that is observed on a Linux machine. If the rename operation is atomic then why it still happens? As I indicated in the description it's because of the way uniqid function works. Is there a plan to merge the PR from http://www.doctrine-project.org/jira/browse/DDC-2210 in a near future? The fix in it would eliminate my issue whatsoever.
        Hide
        Marco Pivetta added a comment - - edited

        Oleg Namaka please continue on the issue that this one is duplicating.

        Show
        Marco Pivetta added a comment - - edited Oleg Namaka please continue on the issue that this one is duplicating.

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            Oleg Namaka
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: