dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

Dubbo 2.7.1 : delay export function doesn't work...

Open spiritme1984 opened this issue 7 years ago • 2 comments

I set 'delay' label in dubbo config file as below:

  <dubbo:provider timeout="${dubbo.timeout}" retries="${dubbo.retry}" accesslog="${dubbo.accesslog}" delay="30000" filter="dubboSofaTracrFilter"/> 

But when I start the project come across an error:

2019-04-29 17:12:21.525 [crm7] [ERROR] [,] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:331) Context initialization failed
java.lang.NullPointerException
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:335)
	at org.apache.dubbo.config.spring.ServiceBean.export(ServiceBean.java:319)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:113)
	at org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:59)
        ....

And I debug the code and found in ServiceConfig.java, there is a method named 'export':

    public synchronized void export() {
        checkAndUpdateSubConfigs();
        if (!shouldExport()) {
            return;
        }
        if (shouldDelay()) {
            delayExportExecutor.schedule(this::doExport, delay, TimeUnit.MILLISECONDS);
        } else {
            doExport();
        }
    }

In this method the 'delay' param is null , and I can't found codes where set value for it. Please correct me if I was wrong, thank you.

spiritme1984 avatar Apr 29 '19 09:04 spiritme1984

I have fixed it in this pr https://github.com/apache/incubator-dubbo/pull/3957

Leishunyu avatar Apr 30 '19 02:04 Leishunyu

This bug has been fixed from 2.7.2 onwards.

ralf0131 avatar Apr 30 '19 08:04 ralf0131