Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System property dubbo.service.delay invalid #1728

Closed
feelwing1314 opened this issue May 3, 2018 · 2 comments
Closed

System property dubbo.service.delay invalid #1728

feelwing1314 opened this issue May 3, 2018 · 2 comments
Labels
help wanted Everything needs help from contributors

Comments

@feelwing1314
Copy link
Contributor

feelwing1314 commented May 3, 2018

根据dubbo参数的映射关系<dubbo:service delay="5000">也可以通过-Ddubbo.service.delay=5000配置,但是发现-Ddubbo.service.delay=5000不起作用;

debug下面这段代码(ServiceConfig.java)发现:

public synchronized void export() {
    ... ...
    if (delay != null && delay > 0) {
        delayExportExecutor.schedule(new Runnable() {
            @Override
            public void run() {
                doExport();
            }
        }, delay, TimeUnit.MILLISECONDS);
    } else {
        doExport();
    }
}

如果有delay,先delay再doExport(),而解析JVM参数的逻辑(appendProperties(this);)是在doExport()方法中调用;所以导致 if (delay != null && delay > 0)判断时,还没有解析JVM参数-Ddubbo.service.delay=5000,从而导致这种配置不起作用;

@ralf0131
Copy link
Contributor

ralf0131 commented May 7, 2018

Would you please send a pull request?

@ralf0131 ralf0131 added help wanted Everything needs help from contributors good first issue labels Jul 16, 2018
cnn112002 pushed a commit to cnn112002/incubator-dubbo that referenced this issue Aug 12, 2018
noahziheng pushed a commit to noahziheng/incubator-dubbo that referenced this issue Aug 13, 2018
hopefulnick added a commit to hopefulnick/incubator-dubbo that referenced this issue Aug 14, 2018
liangjingwen pushed a commit to liangjingwen/incubator-dubbo that referenced this issue Aug 14, 2018
@wanwanpp wanwanpp mentioned this issue Aug 14, 2018
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment