Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-6999

Kie server client load balancer using wrong URL under concurrent access

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.8.0.Final
    • Component/s: None
    • Labels:
      None
    • Docs QE Status:
      NEW
    • QE Status:
      NEW

      Description

      We recently moved both the kie server jar and the kie client jar to 7.4.1 (from 6.4)
      After this change what we are noticing is that we sometimes see a spike in kieserver 404s due the kie-server-client jar 'post'ing on incorrect urls

      For e.g. when it is working ok, it posts on this url:
      https://kieserver.company.com/kie-server/services/rest/server/containers/instances/kie_container
      but when it is having "issues" it starts posting to this url (notice the duplicate "containers/instances/kie_container"")
      https://kieserver.company.com/kie-server/services/rest/server/containers/instances/kie_container/containers/instances/kie_container

      Restarting the client application seems to fix it.

      The exact stack trace I see is as below

      org.kie.server.api.exception.KieServicesHttpException: Unexpected HTTP response code when requesting URI 'https://kieserver.company.com/kie-server/services/rest/server/containers/instances/kie_container/containers/instances/kie_container'! Error code: 404, message:
      at org.kie.server.client.impl.AbstractKieServicesClientImpl.createExceptionForUnexpectedResponseCode(AbstractKieServicesClientImpl.java:617)
      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:290)
      at org.kie.server.client.impl.AbstractKieServicesClientImpl.makeHttpPostRequestAndCreateServiceResponse(AbstractKieServicesClientImpl.java:268)
      at org.kie.server.client.impl.RuleServicesClientImpl.executeCommandsWithResults(RuleServicesClientImpl.java:48)

      This issue comes when we have only one url as availableendpoints. In case of exception url is marked as offline and before url comes back online second failure add url with containers/instances/kie_container as failedendpoints and next time that url would be mark as online. I am able to reproduce this issue with kie 7.4.1
      Here is the git repo to reproduce this issue :

      https://github.intuit.com/mbhalodi/KieServiceClientTest

      Also I tested this issue with below fix and it works :

      @Override
      public String markAsOffline(String url) {
      checkEmpty(availableEndpoints);
      synchronized (availableEndpoints) {

      checkEmpty(availableEndpoints);*
      String baseUrl = locateUrl(availableEndpoints, url);
      availableEndpoints.remove(baseUrl);
      return baseUrl;
      Just need to check if availableEndpoints is not null before marking it as offline. Please let me know if you need more details from myside.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swiderski.maciej Maciej Swiderski
                Reporter:
                mbhalodi_intuit Minal Bhalodi
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: