Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-6982

Kogito Persistence addon for Postgresql breaks Serverless Workflow process into infinite loop

XMLWordPrintable

    • False
    • None
    • False
    • Hide

       
      Prerequisites: you must have enabled Kogito persistence addon for Postgresql

      <groupId>org.kie.kogito</groupId>
      <artifactId>kogito-addons-quarkus-persistence-postgresql</artifactId>
      <version>1.20.0.Final</version>

      Expected behavior:

      1. Start main process (http://localhost:8080/MainFlow)
        Following message will be in the logs:
        MainFlow has started
        SubFlow1 has started
        Event1: <PID_Event1>
      2. Send Event1 for <PID_Event1>
        Following messages will appear in the logs:
        SubFlow2 has started
        Event2: <PID_Event2>
      3. Send Event2 <PID_Event2>
        Message in logs:
        SubFlow2 has ended
        SubFlow1 has ended
        SubFlow3 has started
        SubFlow1 has started
        Event1: <PID_Event1>
      4. Send Event1 <PID_Event1>
        Message in logs:
        SubFlow2 has started
        Event2: <PID_Event2>
      5. Send Event2 <PID_Event2>
        Message in logs:
        SubFlow2 has ended
        SubFlow1 has ended
        SubFlow3 has ended
        MainFlow has ended
      6. MainFlow must end

      Actual behavior

      1. Start main process (http://localhost:8080/MainFlow)
        Following message will be in the logs:
        MainFlow has started
        SubFlow1 has started
        Event1: <PID_Event1>
      2. Send Event1 for <PID_Event1>
        Following messages will appear in the logs:
        SubFlow2 has started
        Event2: <PID_Event2>
      3. Send Event2 <PID_Event2>
        Message in logs:
        SubFlow2 has ended
        SubFlow1 has ended
        SubFlow3 has ended
        SubFlow3 has started
        SubFlow1 has started
        Event1: <PID_Event1>
         
      4. Send Event1 <PID_Event1>
        Message in logs:
        SubFlow2 has started
        Event2: <PID_Event2>
      5. Send Event2 <PID_Event2>
        Message in logs:
        SubFlow2 has ended
        SubFlow1 has ended
        SubFlow3 has ended
        SubFlow3 has started
        SubFlow1 has started
        Event1: <PID_Event1>
         
      6. MainFlow doesn't end
      Show
        Prerequisites : you must have enabled Kogito persistence addon for Postgresql <groupId>org.kie.kogito</groupId> <artifactId>kogito-addons-quarkus-persistence-postgresql</artifactId> <version>1.20.0.Final</version> Expected behavior : Start main process ( http://localhost:8080/MainFlow) Following message will be in the logs: MainFlow has started SubFlow1 has started Event1: <PID_Event1> Send Event1 for <PID_Event1> Following messages will appear in the logs: SubFlow2 has started Event2: <PID_Event2> Send Event2 <PID_Event2> Message in logs: SubFlow2 has ended SubFlow1 has ended SubFlow3 has started SubFlow1 has started Event1: <PID_Event1> Send Event1 <PID_Event1> Message in logs: SubFlow2 has started Event2: <PID_Event2> Send Event2 <PID_Event2> Message in logs: SubFlow2 has ended SubFlow1 has ended SubFlow3 has ended MainFlow has ended MainFlow must end Actual behavior :  Start main process ( http://localhost:8080/MainFlow) Following message will be in the logs: MainFlow has started SubFlow1 has started Event1: <PID_Event1> Send Event1 for <PID_Event1> Following messages will appear in the logs: SubFlow2 has started Event2: <PID_Event2> Send Event2 <PID_Event2> Message in logs: SubFlow2 has ended SubFlow1 has ended SubFlow3 has ended SubFlow3 has started SubFlow1 has started Event1: <PID_Event1>   Send Event1 <PID_Event1> Message in logs: SubFlow2 has started Event2: <PID_Event2> Send Event2 <PID_Event2> Message in logs: SubFlow2 has ended SubFlow1 has ended SubFlow3 has ended SubFlow3 has started SubFlow1 has started Event1: <PID_Event1>   MainFlow doesn't end
    • ---
    • ---
    • 2022 Week 14-16 (from Apr 4), 2022 Week 17-19 (from Apr 25)

      We have a flow like that: 

      mainFlow -> subflow1 -> eventFlow1
                                            -> subflow2 -> eventFlow2
                      -> subflow3 -> subflow1
       

      If we start process without kogito-addons-quarkus-persistence-postgresql, we'll have the following sequence of actions:

      MainFlow has started
      SubFlow1 has started
      Event1: bf642b23-7df8-4e5e-9ff4-d9b8478ecf08
      SubFlow2 has started
      Event2: 377540a3-6759-490f-bf10-1e01003763a8
      SubFlow2 has ended
      SubFlow1 has ended
      SubFlow3 has started
      SubFlow1 has started
      Event1: 48143e5a-e9a8-4db6-9e7e-37b63ad0d6f0
      SubFlow2 has started
      Event2: 5c06638d-b383-4e41-b95b-8880a1302d17
      SubFlow2 has ended
      SubFlow1 has ended
      SubFlow3 has ended
      MainFlow has ended

      But if we add kogito-addons-quarkus-persistence-postgresql, then there'll be infinite loop like that: 

      MainFlow has started
      SubFlow1 has started
      Event1: fa6efc39-cbe9-444e-9450-08d410233f22
      SubFlow2 has started
      Event2: 20b1f90d-0b97-4a47-b73f-339f70226b90
      SubFlow2 has ended
      SubFlow1 has ended
      SubFlow3 has ended
      SubFlow3 has started
      SubFlow1 has started
      Event1: eb46c18f-07ed-42f1-a47e-f6b0ccf16a1d
      SubFlow2 has started
      Event2: d2e4e188-663c-4859-a226-011f0d2c7519
      SubFlow2 has ended
      SubFlow1 has ended
      SubFlow3 has ended
      SubFlow3 has started
      SubFlow1 has started
      Event1: c725de01-e513-472f-8315-8fd1cde72265
      ...

      All SW examples are in attachment.
      Kogito version: 1.20.0.Final
      SW spec: 0.8

        1. subflow1.sw.yml
          1 kB
        2. subflow2.sw.yml
          0.9 kB
        3. subflow3.sw.yml
          0.9 kB
        4. main-flow.sw.yml
          1 kB
        5. event-flow2.sw.yml
          0.6 kB
        6. event-flow.sw.yml
          0.6 kB

              cnicolai@redhat.com Cristiano Nicolai (Inactive)
              bigtigershark Mikhail Gerasimov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: