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

Postgresql persistence generates Timeout in SW workflow

XMLWordPrintable

    • False
    • False
    • Hide

      For reproducing the issue the following example can be used:

       

      1) clone the following repository https://github.com/wmedvede/kogito-examples

      and switch to the branch KOGITO-6640-postgresql-issue-reproducer

       

      2) the following directory contains the example application.

      serverless-workflow-qas-service-showcase

       

      3) Please build the directory by using the postgresql maven profile

       

      cd serverless-workflow-qas-service-showcase
      mvn clean install -Dpostgresql
      

       

       

      4) two applications will be generated

       

      query-service
      query-answer-service
      

       

       

      5) Ensure kafka is running locally

       

      6) Ensure a postgresql database is running locally

       

      7) start the query-service application with:

      java -jar target/quarkus-app/quarkus-run.jar

      After this step a webapp will be started in http://localhost:8280

       

      8) start the query-answer-service with:  (this application contains the SW)

      java -jar target/quarkus-app/quarkus-run.jar

       

      to configure the postgresql database see the application.properties file.

       

      9) create a process instance by using the swagger-ui

      use the POST qaservice method and pass the json bellow as parameter.

       

      11) By querying the postgresql DB we can verify that the process instance was created and property saved in database.

       

      12) Open a browser window in the url http://localhost:8280

      and answer the formulated query by using the webapp

       

      11) When the send button is pressed a Kafka event is produced and sent to the SW. At this point the SW receives the event and the reported exception is produced. See the Jira description.

      And we can verify that the process was not completed.

       

       

       

      NOTE:

      If we build the project by NOT using the postgresql profile (process instances stored in memory) and reproduce all the steps, we can see that the SW works fine. In the console we can see the logs and that the process has finished, etc.

       

       

       

       

       

      Show
      For reproducing the issue the following example can be used:   1) clone the following repository https://github.com/wmedvede/kogito-examples and switch to the branch KOGITO-6640 -postgresql-issue-reproducer   2) the following directory contains the example application. serverless-workflow-qas-service-showcase   3) Please build the directory by using the postgresql maven profile   cd serverless-workflow-qas-service-showcase mvn clean install -Dpostgresql     4) two applications will be generated   query-service query-answer-service     5) Ensure kafka is running locally   6) Ensure a postgresql database is running locally   7) start the query-service application with: java -jar target/quarkus-app/quarkus-run.jar After this step a webapp will be started in http://localhost:8280   8) start the query-answer-service with:  (this application contains the SW) java -jar target/quarkus-app/quarkus-run.jar   to configure the postgresql database see the application.properties file.   9) create a process instance by using the swagger-ui use the POST qaservice method and pass the json bellow as parameter.   11) By querying the postgresql DB we can verify that the process instance was created and property saved in database.   12) Open a browser window in the url http://localhost:8280 and answer the formulated query by using the webapp   11) When the send button is pressed a Kafka event is produced and sent to the SW. At this point the SW receives the event and the reported exception is produced. See the Jira description. And we can verify that the process was not completed.       NOTE: If we build the project by NOT using the postgresql profile (process instances stored in memory) and reproduce all the steps, we can see that the SW works fine. In the console we can see the logs and that the process has finished, etc.          
    • 2021 Week 49-51 (from Dec 6th)

      When the reproducer provided in:

      https://github.com/wmedvede/kogito-examples/tree/KOGITO-6640-postgresql-issue-reproducer

       

      Is executed by using postgresql persistence the following exception is produced:

       

      https://gist.github.com/wmedvede/4d4640d3793787cf15c49b6046a0969c

       

      Caused by: java.lang.RuntimeException: Error finding process instance 2ea5bc57-e30e-47fd-91a7-6276800458ec
          at org.kie.kogito.persistence.postgresql.PostgreProcessInstances.uncheckedException(PostgreProcessInstances.java:177)
          at org.kie.kogito.persistence.postgresql.PostgreProcessInstances.findByIdInternal(PostgreProcessInstances.java:243)
          at org.kie.kogito.persistence.postgresql.PostgreProcessInstances.findById(PostgreProcessInstances.java:120)
          at org.kie.kogito.process.ProcessInstances.findById(ProcessInstances.java:24)
          at org.kie.kogito.event.impl.CloudEventConsumer.consume(CloudEventConsumer.java:66)
          at org.kie.kogito.services.event.impl.AbstractMessageConsumer.consume(AbstractMessageConsumer.java:102)
          at org.kie.kogito.services.event.impl.AbstractMessageConsumer.consumeCloud(AbstractMessageConsumer.java:93)
          at org.kie.kogito.addon.quarkus.messaging.common.AbstractQuarkusCloudEventReceiver.lambda$produce$1(AbstractQuarkusCloudEventReceiver.java:61)
          at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
          ... 47 more
      Caused by: java.util.concurrent.TimeoutException
          at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1886)
          at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2021)
          at org.kie.kogito.persistence.postgresql.PostgreProcessInstances.getResultFromFuture(PostgreProcessInstances.java:226)
          at org.kie.kogito.persistence.postgresql.PostgreProcessInstances.findByIdInternal(PostgreProcessInstances.java:238)

       

       

       

       

       

       

            tdolphin-1 Tiago Dolphine
            wmedvede@redhat.com Walter Medvedeo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: