seata 启动获取配置中心consul配置参数失败

velaa5lx  于 2个月前  发布在  其他
关注(0)|答案(3)|浏览(25)
  • I have searched the issues of this repository and believe that this is not a duplicate.

Ⅰ. Issue Description

启动获取配置中心consul配置参数失败,导致启动时间过长

Ⅱ. Describe what happened

2021-06-24 10:29:10.916 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'io.seata.spring.boot.autoconfigure.SeataAutoConfiguration' of type [io.seata.spring.boot.autoconfigure.SeataAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.948 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'failureHandler' of type [io.seata.tm.api.DefaultFailureHandlerImpl] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.954 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration' of type [org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$2ba23a4a] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.957 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'bindersHealthContributor' of type [org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration$BindersHealthContributor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.958 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'bindersHealthIndicatorListener' of type [org.springframework.cloud.stream.config.BindersHealthIndicatorAutoConfiguration$BindersHealthIndicatorListener] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.961 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.stream.binder.rabbit.config.ExtendedBindingHandlerMappingsProviderConfiguration' of type [org.springframework.cloud.stream.binder.rabbit.config.ExtendedBindingHandlerMappingsProviderConfiguration$$EnhancerBySpringCGLIB$$dda78abf] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.962 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'rabbitExtendedPropertiesDefaultMappingsProvider' of type [org.springframework.cloud.stream.binder.rabbit.config.ExtendedBindingHandlerMappingsProviderConfiguration$$Lambda$404/33446839] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.966 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'BindingHandlerAdvise' of type [org.springframework.cloud.stream.config.BindingHandlerAdvise] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.969 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'stringToNoneShardingStrategyConfigurationConverter' of type [org.apache.shardingsphere.spring.boot.converter.StringToNoneShardingStrategyConfigurationConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.972 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spelConverter' of type [org.springframework.cloud.stream.config.SpelExpressionConverterConfiguration$SpelConverter] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.977 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'springCloudAlibabaConfiguration' of type [io.seata.spring.boot.autoconfigure.properties.SpringCloudAlibabaConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.979 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'seataProperties' of type [io.seata.spring.boot.autoconfigure.properties.SeataProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:10.980 INFO  --- [           main] i.s.s.b.a.SeataAutoConfiguration         : Automatically configure Seata
2021-06-24 10:29:10.983 INFO  --- [           main] io.seata.config.FileConfiguration        : The file name of the operation is registry
2021-06-24 10:29:11.026 INFO  --- [           main] io.seata.config.ConfigurationFactory     : load Configuration:FileConfiguration$$EnhancerByCGLIB$$862af1eb
2021-06-24 10:29:11.031 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'configProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:29:16.096 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5005 ms,op:GET,dataId:service.disableGlobalTransaction
2021-06-24 10:29:16.099 INFO  --- [           main] i.s.s.a.GlobalTransactionScanner         : Initializing Global Transaction Clients ... 
2021-06-24 10:29:21.108 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.threadFactory.bossThreadPrefix
2021-06-24 10:29:26.109 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5001 ms,op:GET,dataId:transport.threadFactory.workerThreadPrefix
2021-06-24 10:29:31.112 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.threadFactory.shareBossWorker
2021-06-24 10:29:36.117 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5003 ms,op:GET,dataId:transport.type
2021-06-24 10:29:41.118 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5001 ms,op:GET,dataId:transport.threadFactory.workerThreadSize
2021-06-24 10:29:46.125 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.server
2021-06-24 10:29:51.137 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5001 ms,op:GET,dataId:transport.heartbeat
2021-06-24 10:29:56.139 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.enableClientBatchSendRequest
2021-06-24 10:30:01.153 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.threadFactory.clientSelectorThreadSize
2021-06-24 10:30:06.158 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.threadFactory.clientSelectorThreadPrefix
2021-06-24 10:30:11.212 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:transport.threadFactory.clientWorkerThreadPrefix
2021-06-24 10:30:11.216 INFO  --- [           main] i.s.core.rpc.netty.NettyClientBootstrap  : NettyClientBootstrap has started
2021-06-24 10:30:11.216 INFO  --- [           main] i.s.s.a.GlobalTransactionScanner         : Transaction Manager Client is initialized. applicationId[mtstar-web] txServiceGroup[mtstar-web_group]
2021-06-24 10:30:16.226 ERROR --- [           main] io.seata.config.ConfigFuture             : config operation timeout,cost:5002 ms,op:GET,dataId:client.rm.asyncCommitBufferLimit
2021-06-24 10:30:16.226 INFO  --- [           main] io.seata.rm.datasource.AsyncWorker       : Async Commit Buffer Limit: 10000
2021-06-24 10:30:16.227 INFO  --- [           main] i.s.rm.datasource.xa.ResourceManagerXA   : ResourceManagerXA init ...
2021-06-24 10:30:16.235 INFO  --- [           main] i.s.core.rpc.netty.NettyClientBootstrap  : NettyClientBootstrap has started
2021-06-24 10:30:16.236 INFO  --- [           main] i.s.s.a.GlobalTransactionScanner         : Resource Manager is initialized. applicationId[mtstar-web] txServiceGroup[mtstar-web_group]
2021-06-24 10:30:16.236 INFO  --- [           main] i.s.s.a.GlobalTransactionScanner         : Global Transaction Clients are initialized. 
2021-06-24 10:30:16.243 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'spring.shardingsphere-org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration' of type [org.apache.shardingsphere.spring.boot.prop.SpringBootPropertiesConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.440 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.apache.shardingsphere.spring.boot.SpringBootConfiguration' of type [org.apache.shardingsphere.spring.boot.SpringBootConfiguration$$EnhancerBySpringCGLIB$$ffd76a20] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.466 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.retry.annotation.RetryConfiguration' of type [org.springframework.retry.annotation.RetryConfiguration$$EnhancerBySpringCGLIB$$dd8b38cb] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.556 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationChannelResolver' of type [org.springframework.integration.support.channel.BeanFactoryChannelResolver] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.558 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'integrationDisposableAutoCreatedBeans' of type [org.springframework.integration.config.annotation.Disposables] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.578 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.integration.config.IntegrationManagementConfiguration' of type [org.springframework.integration.config.IntegrationManagementConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.582 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration' of type [org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.591 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration' of type [org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.595 INFO  --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mbeanServer' of type [com.sun.jmx.mbeanserver.JmxMBeanServer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-06-24 10:30:16.612 INFO  --- [ig-executor_1_1] trationDelegate$BeanPostProcessorChecker : Bean 'configConsulProperties' of type [io.seata.spring.boot.autoconfigure.properties.config.ConfigConsulProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

Ⅲ. Describe what you expected to happen

从配置中心consul获取到正确配置数据

Ⅳ. How to reproduce it (as minimally and precisely as possible)

  1. 启动seata服务端,注册中心和配置中心都设置为consul,参数通过脚本都提交到consul
  2. 客户端seata配置
seata:
  enabled: true
  application-id: ${spring.application.name}
  tx-service-group: mtstar-web_group
  enable-auto-data-source-proxy: true
  config:
    type: consul
    consul:
      serverAddr: 172.30.0.28:8500
  registry:
    type: consul
    consul:
      cluster: default
      serverAddr: 172.30.0.28:8500
  service:
    vgroupMapping:
      mtstar-web_group: default
    enable-degrade: false
    disable-global-transaction: false

Ⅴ. Anything else we need to know?

通过断点调试,发现类ConsulConfiguration.getLatestConfig()方法中获取consul配置使用了线程池,主线程没有等到读取完配置就返回了,所以产生了上述日志

public String getLatestConfig(String dataId, String defaultValue, long timeoutMills) {
        String value = this.getConfigFromSysPro(dataId);
        if (value != null) {
            return value;
        } else {
            ConfigFuture configFuture = new ConfigFuture(dataId, defaultValue, ConfigOperation.GET, timeoutMills);
            this.consulNotifierExecutor.execute(() -> {
                this.complete(getConsulClient().getKVValue(dataId, getAclToken()), configFuture);
            });
            return (String)configFuture.get();
        }
    }

Ⅵ. Environment:

  • JDK version : 8
  • seata-spring-boot-starter:1.4.2
  • spring-cloud-starter-consul-discovery: 2.2.7.RELEASE
  • spring-boot: 2.3.10.RELEASE
chhqkbe1

chhqkbe11#

同样的问题 设计不合理 看看怎么改

0yycz8jy

0yycz8jy2#

private static ConsulClient getConsulClient() { if (client == null) { synchronized (ConsulConfiguration.class) { if (client == null) { String serverAddr = FILE_CONFIG.getConfig(FILE_CONFIG_KEY_PREFIX + SERVER_ADDR_KEY); InetSocketAddress inetSocketAddress = NetUtil.toInetSocketAddress(serverAddr); client = new ConsulClient(inetSocketAddress.getHostName(), inetSocketAddress.getPort()); } } } return client; }

迟迟不能返回 consul的address

m2xkgtsf

m2xkgtsf3#

seata-spring-boot-starter: 1.5.1.1,问题依然存在

相关问题