Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14327

Jt400PgmProducer doStop() method called on actively used instance

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1, 3.1.0
    • camel-jt400
    • None
    • Unknown

    Description

      Today I migrated to 3.0.0 version and there seems to be an issue with Service pooling for the Jt400PgmpProducer.

       

      Here's what I have:

       

          from(
              "seda:someName?concurrentConsumers=2&size=10")
                  .to("jt400://{{as400.user}}:{{as400.password}}@{{as400.host}}/QSYS.LIB/PROGRAM.LIB/KFKEVR.SRVPGM?fieldsLength=200,2000,4,8,8,1000&outputFieldsIdx=0,1,2,3,4,5&connectionPool=#as400ConnectionPool&format=binary&procedureName=RECEIVEEVENT");
      

      When concurrentConsumers attribute of seda endpoint is set to 1 everything works fine, but when it is greater than 1 then it looks like the evict method from MultiplePool class calls stop method on a Jt400PgmProducer instance that is still being used (the process method on it is still getting called). This results in nulling the iSeries object inside Jt400PgmProducer instance:

          @Override
          protected void doStop() throws Exception {
              if (iSeries != null) {
                  LOG.info("Releasing connection to {}", getISeriesEndpoint());
                  getISeriesEndpoint().releaseSystem(iSeries);
                  iSeries = null;
              }
          }
      

      and when the process method gets called later on this instance, it fails with NPE while constructing ServiceProgramCall:

          @Override
          public void process(Exchange exchange) throws Exception {
      ...
                  pgmCall = new ServiceProgramCall(iSeries);
      ...            
      

       

      I believe this may be related to producer caching in ServicePool class, some sort of key issue in the cache Map maybe?

      Attachments

        1. jt400_2.patch
          4 kB
          Rafał Gała
        2. jt400.patch
          7 kB
          Rafał Gała
        3. jt400.patch
          4 kB
          Rafał Gała

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rgala Rafał Gała
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: