You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "wizhuo (via GitHub)" <gi...@apache.org> on 2023/02/22 07:34:03 UTC

[GitHub] [shardingsphere-elasticjob] wizhuo opened a new issue, #2188: JobScheduler init sequence which result in use wrong ElasticJobListener

wizhuo opened a new issue, #2188:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2188

   ## Bug Report
   
   ### Which version of ElasticJob did you use?
    Latest version  for master branch
   ### Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?
   ElasticJob-Lite
   ### Expected behavior
   The job  configuration  save in zookeeper is as follows
   ````
   cron: 0/5 * * * * ?
   description: ''
   disabled: false
   failover: false
   jobExtraConfigurations:
   - !!org.apache.shardingsphere.elasticjob.tracing.yaml.YamlTracingConfiguration
     tracingStorageConfiguration: !!org.apache.shardingsphere.elasticjob.tracing.rdb.yaml.YamlDataSourceConfiguration
       dataSourceClassName: org.apache.commons.dbcp2.BasicDataSource
       props:
         logAbandoned: false
         numTestsPerEvictionRun: 3
         url: jdbc:h2:mem:job_event_storage
         timeBetweenEvictionRunsMillis: -1
         enableAutoCommitOnReturn: true
         removeAbandonedTimeout: 300
         lifo: true
         softMinEvictableIdleTimeMillis: -1
         driverClassName: org.h2.Driver
         rollbackOnReturn: true
         abandonedUsageTracking: false
         testOnBorrow: true
         testOnReturn: false
         numIdle: 1
         maxIdle: 8
         minIdle: 0
         logExpiredConnections: true
         maxTotal: 8
         numActive: 0
         defaultTransactionIsolation: -1
         testOnCreate: false
         removeAbandonedOnMaintenance: false
         fastFailValidation: false
         password: ''
         cacheState: true
         initialSize: 0
         maxWaitMillis: -1
         validationQueryTimeout: -1
         evictionPolicyClassName: org.apache.commons.pool2.impl.DefaultEvictionPolicy
         maxOpenPreparedStatements: -1
         removeAbandonedOnBorrow: false
         connectionInitSqls: []
         testWhileIdle: false
         autoCommitOnReturn: true
         minEvictableIdleTimeMillis: 1800000
         maxConnLifetimeMillis: -1
         username: sa
     type: RDB
   jobListenerTypes:
   - B
   jobName: javaSimpleJob
   jobParameter: ''
   maxTimeDiffSeconds: -1
   misfire: true
   monitorExecution: true
   overwrite: false
   reconcileIntervalMinutes: 10
   shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou
   shardingTotalCount: 3
   staticSharding: false
   ```
   when  local jobConfig change jobListenerTypes to 'A' ,overwrite is false ,and restart the job  . I found the job use the jobListenerTypes  is A but not B  
   the Expected behavior is the job use  the jobListenerTypes is B ,because the overwrite is false,so ,it should use the config of zookeeper
   ### Actual behavior
   job use the jobListenerTypes  is A
   ### Reason analyze (If you can)
   
   Before loading the latest configuration file from zookeeper, the local jobConfig is used in the constructor to get the jobListenerTypes , which results in the  jobListenerTypes of locally jobConfig always being used, regardless of whether configuration overrides are allowed
   
   ![image](https://user-images.githubusercontent.com/46399833/220544804-4bd697ab-4728-4030-b17a-3710499c985f.png)
   
   
   ### Steps to reproduce the behavior.
   1、start a new job which jobListenerTypes  is B 
   2、change jobListenerTypes   to A and overwrite  is false  ,restart the job
   
   
   ### Example codes for reproduce this issue (such as a github link).
   1、
   ```
       private static void setUpSimpleJob(final CoordinatorRegistryCenter regCenter, final TracingConfiguration<DataSource> tracingConfig) {
           new ScheduleJobBootstrap(regCenter, new JavaSimpleJob(), JobConfiguration.newBuilder("javaSimpleJob", 3)
                   .cron("0/5 * * * * ?").shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou").addExtraConfigurations(tracingConfig).jobListenerTypes("B").build()).schedule();
       }
   ```
   2、
   ```
      private static void setUpSimpleJob(final CoordinatorRegistryCenter regCenter, final TracingConfiguration<DataSource> tracingConfig) {
           new ScheduleJobBootstrap(regCenter, new JavaSimpleJob(), JobConfiguration.newBuilder("javaSimpleJob", 3)
                   .cron("0/5 * * * * ?").shardingItemParameters("0=Beijing,1=Shanghai,2=Guangzhou").addExtraConfigurations(tracingConfig).jobListenerTypes("A").build()).schedule();
       }
   ```
   #2187 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere-elasticjob] TeslaCN closed issue #2188: JobScheduler init sequence which result in use wrong ElasticJobListener

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN closed issue #2188:  JobScheduler init sequence which result in  use wrong ElasticJobListener
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2188


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org