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

Hot reload false negative instrumentation for DecisionModels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • Core Engine
    • None
    • 5
    • False
    • False
    • Undefined
    • Hide

      In an attempt to contribute my part, I've tried to follow the advice in here.
      So I've built a simple module which would test maven invoker style per the linked DevMojoIT

      The second change of the .dmn resource fails, and I believe this might be a good demonstration of how the Kogito hot reload is currently broken.

      It is very likely I am missing either knowledge of some of the more internals of the Kogito-quarkus extension, or either Quarkus instrumentation is doing something unexpected here.

      The test prepares a basic Kogito-on-Quarkus maven app with a simple DMN, containing a decision which prefix "Hello, " the name given in input.
      The first http call works as expected, the returned value is "Hello, v1".
      The test then mutates the content of the dmn, now the decision should prefix "Ciao, ".
      This second http call works again as expected, the returned value is "Ciao, v1".
      The test then mutates again the content of the dmn, now it is expecting to prefix "Bonjour, ".
      As can be seen in the log, attached, this fails, since the Ciao-prefix is still occuring.
      build-project-intrumentation-reload-dmn.log

      As an attempt to understand better what's going on, I have added a simple UUID sysout in the DecisionModels generated class.
      What is quite troubling to me, is that the content of the generated class in target/generated-sources/kogito/org/kie/kogito/app/DecisionModels.java is actually the UUID of the Kogito-extension deliberate 1st forced-reload which is performed anyway by the Kogito-extension --as I understand, this is a "dirty patch" introduced and required some time ago.
      Attached screenshot

      So to recap, for some reason:
      1. The test starts, the kogito-extension does the 1st forced-reload, and the first http call to DMN is working as expected for "Hello, " prefix.
      At this stage the content of target/generated-sources/kogito/org/kie/kogito/app is synced correctly, as-expected.
      2. The test mutates the content of the DMN file, a hotreload is triggered
      an error is reported java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the class NestHost or NestMembers attribute
      the quarkus application restarts
      the second call to DMN is working as expected for the "Ciao, " prefix
      BUT the content of target/generated-sources/kogito/org/kie/kogito/app appears is NO longer aligned.
      The expected UUID printed out on the log is abba6b6c-909d-4584-ab41-0f7247d41dfb but this no longer corresponds to the UUID in the kogito generated-sources.
      3. The test mutates the content of the DMN file another time, a hotreload is triggered, the third call to DMN is not working as expected for the "Bonjour, " prefix

      I am lost why the content of generated-sources/kogito/org/kie/kogito/app is not maintained in sync after the first forced-reload and more in general what could be at play here.

      [1] https://github.com/kiegroup/kogito-runtimes/compare/master...tarilabs:tarilabs-20210219-hotreload2ndbroke

      Show
      In an attempt to contribute my part, I've tried to follow the advice in here . So I've built a simple module which would test maven invoker style per the linked DevMojoIT The second change of the .dmn resource fails, and I believe this might be a good demonstration of how the Kogito hot reload is currently broken. It is very likely I am missing either knowledge of some of the more internals of the Kogito-quarkus extension, or either Quarkus instrumentation is doing something unexpected here. The test prepares a basic Kogito-on-Quarkus maven app with a simple DMN, containing a decision which prefix "Hello, " the name given in input. The first http call works as expected, the returned value is "Hello, v1". The test then mutates the content of the dmn, now the decision should prefix "Ciao, ". This second http call works again as expected, the returned value is "Ciao, v1". The test then mutates again the content of the dmn, now it is expecting to prefix "Bonjour, ". As can be seen in the log, attached, this fails, since the Ciao-prefix is still occuring. build-project-intrumentation-reload-dmn.log As an attempt to understand better what's going on, I have added a simple UUID sysout in the DecisionModels generated class. What is quite troubling to me, is that the content of the generated class in target/generated-sources/kogito/org/kie/kogito/app/DecisionModels.java is actually the UUID of the Kogito-extension deliberate 1st forced-reload which is performed anyway by the Kogito-extension --as I understand, this is a "dirty patch" introduced and required some time ago. Attached screenshot So to recap, for some reason: 1. The test starts, the kogito-extension does the 1st forced-reload, and the first http call to DMN is working as expected for "Hello, " prefix. At this stage the content of target/generated-sources/kogito/org/kie/kogito/app is synced correctly, as-expected. 2. The test mutates the content of the DMN file, a hotreload is triggered an error is reported java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the class NestHost or NestMembers attribute the quarkus application restarts the second call to DMN is working as expected for the "Ciao, " prefix BUT the content of target/generated-sources/kogito/org/kie/kogito/app appears is NO longer aligned. The expected UUID printed out on the log is abba6b6c-909d-4584-ab41-0f7247d41dfb but this no longer corresponds to the UUID in the kogito generated-sources. 3. The test mutates the content of the DMN file another time, a hotreload is triggered, the third call to DMN is not working as expected for the "Bonjour, " prefix I am lost why the content of generated-sources/kogito/org/kie/kogito/app is not maintained in sync after the first forced-reload and more in general what could be at play here. [1] https://github.com/kiegroup/kogito-runtimes/compare/master...tarilabs:tarilabs-20210219-hotreload2ndbroke
    • ---
    • ---
    • 2021 Week 07-09 (from Feb 15)

      The DecisionModels is meant to be reloaded, but it would seems to me (so I might be wrong) that for some reasons the quarkus dev mode hotreload instrumentation thinks the class is equivalent hence not reloaded.

      In general the kogito generates-sources are not in sync with the expected classes, and this seems a generalized issue but this JIRA focused only on the regression for DecisionModels

      The problem can be reproduced only using DevMojo maven invoker style, not with ShrinkWrap.

              mmortari@redhat.com Matteo Mortari
              mmortari@redhat.com Matteo Mortari
              Marian Macik Marian Macik
              Marian Macik Marian Macik
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: