Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25551

Fix infinite loop when an Automation chain changes the Blob name on beforeDocumentModification event

    XMLWordPrintable

    Details

    • Release Notes Summary:
      A blob update in an Automation chain triggered on the event "before document modification" will not cause an infinite loop.
    • Tags:
    • Backlog priority:
      800
    • Sprint:
      nxfit 10.3.3
    • Story Points:
      3

      Description

      When changing a file:content Blob filename in an event handler triggered during the Before Document Modification event, an event infinite loop is triggered.

      How to reproduce:
      A) In Studio

      1. Create a document type extending File and customize the creation/view/edit tabs in enabling the choice of file:content
      2. Create an Event Handler triggered on BeforeDocumentModification andth preceding document type and calling an operation chain
      3. Define in Studio Registry an operation Document.UpdatePJTitle and call this operation in the triggered automation chain. Do not save in this operation chain.
        { "operations": [ 
         {
          "id" : "Document.UpdatePJTitle", 
          "label" : "UpdatePJTitle", 
          "category" : "Document", 
          "description" : "Renomme les PJ", 
          "url" : "UpdatePJTitle", 
          "requires" : null, 
          "signature" : [ "document", "document", "documents", "documents" ], 
          "params" : [ ] 
         }
        ]
        }
        

      B) operation

      1. Create using nuxeocli a custom operation Document.UpdatePJTitle (sources and operation attached)

      C) In Nuxeo

      1. Deploy the Studio project
      2. Deploy your custom operation thanks to the attached bundle NXP25551-core-1.0-SNAPSHOT.jar
      3. Start Nuxeo
      4. Create your document type and create a file:content such as a JPEG picture.
        ==> Observe a 100% CPU utilization
        ==> Observe in tab Admin > Monitoring > Event bus (activate both the synchronous and asynchonous event follow up) the number of events sky-rocketing

      Note: this infinite loop does not result in a StackOverflowError: this is an infinite loop of events...
      The net result is in addition that the audit log is rapidly filled up with actions on the document...

      Requesting to fix the infinite events loop

        Attachments

        1. events view in admin console.png
          111 kB
          Patrick Abgrall
        2. UpdatePJTitle.java
          2 kB
          Patrick Abgrall

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 4 hours
                1d 4h