You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/10/19 07:59:36 UTC

[GitHub] [shardingsphere-elasticjob] xiebin2015 opened a new issue #2002: Elasitcjob3 execution problem

xiebin2015 opened a new issue #2002:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2002


   Hi, I have a problem here. In the process of using elasitcjob 3. X, the specific problems are as follows
   The scheduled task is released, and the elasticjoblistener listens to the task execution, but the specific job is not actually executed (the log is not printed). After reading it for a long time, I still can't find the problem


-- 
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



[GitHub] [shardingsphere-elasticjob] vincentjames501 commented on issue #2002: Elasitcjob3 execution problem

Posted by GitBox <gi...@apache.org>.
vincentjames501 commented on issue #2002:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2002#issuecomment-948091085


   Once I turned on debug logging I saw this:
   
   ```
   java.io.IOException: Xid out of order. Got Xid 125 with err -6 expected Xid 123 for a packet with details: clientPath:null serverPath:null finished:false header:: 123,14  replyHeader:: 0,0,-4  request:: org.apache.zookeeper.MultiOperationRecord@f7144ff5 response:: org.apache.zookeeper.MultiResponse@0
   ...
   	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:555)
   DEBUG [Curator-ConnectionStateManager-0] (RetryLoopImpl.java:73) - Retry-able exception received
   org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /my-jobs/MyJob/instances/172.21.32.12@-@48422
   ...
   
   ERROR [main-EventThread] (CuratorFrameworkImpl.java:724) - Background operation retry gave up
   org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss
   ```
   
   I was using docker image `confluentinc/cp-zookeeper:6.2.1`. I'm not sure why, but it doesn't seem to work. I installed and ran zookeeper via homebrew and now is working fine. I haven't dug too much but I suspect a version mismatch or a docker networking issue.


-- 
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



[GitHub] [shardingsphere-elasticjob] vincentjames501 commented on issue #2002: Elasitcjob3 execution problem

Posted by GitBox <gi...@apache.org>.
vincentjames501 commented on issue #2002:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2002#issuecomment-947989641


   I'm running into the same issue. Here is a super simple example:
   
   ```java
   package com.myjobs;
   
   import org.apache.shardingsphere.elasticjob.api.JobConfiguration;
   import org.apache.shardingsphere.elasticjob.api.ShardingContext;
   import org.apache.shardingsphere.elasticjob.lite.api.bootstrap.impl.ScheduleJobBootstrap;
   import org.apache.shardingsphere.elasticjob.reg.base.CoordinatorRegistryCenter;
   import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperConfiguration;
   import org.apache.shardingsphere.elasticjob.reg.zookeeper.ZookeeperRegistryCenter;
   import org.apache.shardingsphere.elasticjob.simple.job.SimpleJob;
   
   public class Main {
       public static class MyJob implements SimpleJob {
           @Override
           public void execute(ShardingContext context) {
               System.out.printf("Here! %s", context);
           }
       }
   
       public static void main(String[] args) {
           System.out.println("here!");
           CoordinatorRegistryCenter registryCenter = createRegistryCenter();
           new ScheduleJobBootstrap(registryCenter, new MyJob(), createScheduledJobConfiguration()).schedule();
       }
   
       private static CoordinatorRegistryCenter createRegistryCenter() {
           CoordinatorRegistryCenter regCenter = new ZookeeperRegistryCenter(new ZookeeperConfiguration("localhost:2181", "my-jobs"));
           regCenter.init();
           return regCenter;
       }
   
       private static JobConfiguration createScheduledJobConfiguration() {
           return JobConfiguration.newBuilder("MyJob", 1).cron("0 0/1 * 1/1 * ? *").build();
       }
   }
   ```
   
   Produces:
   
   ```
   SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
   SLF4J: Defaulting to no-operation (NOP) logger implementation
   SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
   SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
   SLF4J: Defaulting to no-operation MDCAdapter implementation.
   SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
   ```
   
   The job never fires as seen my the missing `Here!`
   
   I can see in zookeeper though the job being registered...
   
   ```
   /my-jobs/MyJob = com.myjobs.Main$MyJob
   ```
   
   ```
   /my-jobs/MyJob/config = 
   cron: 0 0/1 * 1/1 * ? *
   description: ''
   disabled: false
   failover: false
   jobName: MyJob
   jobParameter: ''
   maxTimeDiffSeconds: -1
   misfire: true
   monitorExecution: true
   overwrite: false
   reconcileIntervalMinutes: 10
   shardingItemParameters: ''
   shardingTotalCount: 1
   staticSharding: false
   ```


-- 
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



[GitHub] [shardingsphere-elasticjob] TeslaCN commented on issue #2002: Elasitcjob3 execution problem

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #2002:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2002#issuecomment-963783315


   Hi @xiebin2015 
   Could you show us your configuration? We may need a reproducible way to check this issue.


-- 
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



[GitHub] [shardingsphere-elasticjob] xiebin2015 commented on issue #2002: Elasitcjob3 execution problem

Posted by GitBox <gi...@apache.org>.
xiebin2015 commented on issue #2002:
URL: https://github.com/apache/shardingsphere-elasticjob/issues/2002#issuecomment-971261582


   Hi @TeslaCN 
    @Bean(initMethod = "init")
       public CoordinatorRegistryCenter zookeeperRegistryCenter() {
           ZookeeperConfiguration zkConfig = new ZookeeperConfiguration(zookeeperProperties.getServerLists(), zookeeperProperties.getNamespace());
           zkConfig.setBaseSleepTimeMilliseconds(zookeeperProperties.getBaseSleepTimeMilliseconds());
           zkConfig.setConnectionTimeoutMilliseconds(zookeeperProperties.getConnectionTimeoutMilliseconds());
           zkConfig.setDigest(zookeeperProperties.getDigest());
           zkConfig.setMaxRetries(zookeeperProperties.getMaxRetries());
           zkConfig.setMaxSleepTimeMilliseconds(zookeeperProperties.getMaxSleepTimeMilliseconds());
           zkConfig.setSessionTimeoutMilliseconds(zookeeperProperties.getSessionTimeoutMilliseconds());
           CoordinatorRegistryCenter coordinatorRegistryCenter = new ZookeeperRegistryCenter(zkConfig);
           coordinatorRegistryCenter.init();
           return coordinatorRegistryCenter;
       }
   @Override
       public ScheduleJobBootstrap prepareScheduleJobBootstrap(Job job, Object jobBean) throws PendingException {
           try {
               //作业对象
               ElasticJob elasticjob = (ElasticJob) jobBean;
               return new ScheduleJobBootstrap(getCoordinatorRegistryCenter(), elasticjob, jobCoreConfiguration(job));
           } catch (Exception e) {
               log.error("【" + job.getJobName() + "】\t初始化失败", e);
               throw new PendingException(SysCode.SYS_FAIL, "\"【\" + job.getJobName() + \"】\\t初始化失败", e);
           }
       }
   
       


-- 
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