- [*] I have searched the [issues](https://github.com/apache/dubbo/issues) of 
this repository and believe that this is not a duplicate.
- [*] I have checked the 
[FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository 
and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.5-SNAPSHOT
* Operating System version: macOS  Catalina
* Java version: jdk-11.0.5.jdk

### Steps to reproduce this issue

1. start zookeeper localhost
2. write  code consumer-side, like this
```java
   public class ConsumerApplication {

        private static String zookeeperHost = 
System.getProperty("zookeeper.address", "127.0.0.1");

        public static void main(String[] args) {
                ReferenceConfig<DemoService> reference = new 
ReferenceConfig<>();
                reference.setApplication(new 
ApplicationConfig("first-dubbo-consumer"));
                reference.setRegistry(new RegistryConfig("zookeeper://" + 
zookeeperHost + ":2181"));
                reference.setInterface(DemoService.class);

                DemoService service = reference.get();
                String message = service.sayHello("dubbo");

                System.out.println(message);
        }
}

```
3. write code provider-side like this
```java
public class Application {

        private static String zookeeperHost = 
System.getProperty("zookeeper.address", "127.0.0.1");

        public static void main(String[] args) throws Exception {
                ServiceConfig<DemoService> service = new 
ServiceConfig<DemoService>();
                service.setApplication(new 
ApplicationConfig("first-dubbo-provider"));
                service.setRegistry(new RegistryConfig("zookeeper://" + 
zookeeperHost + ":2181"));
                service.setInterface(DemoService.class);
                service.setRef(new DemoServiceImpl());
                service.setParameters(new HashMap<>());
                service.export();

                System.out.println("dubbo service started");
                new CountDownLatch(1).await();
        }
}
```
4. serviceImpl code like this
```
@Service(version = "1.0.0",timeout = 9000)
public class DemoServiceImpl implements DemoService {

    @Override
    public String sayHello(String name) {
            try{
                Thread.sleep(7000);
        }catch (Exception ex){

        }
        return "Hello, " + name + ", " + new Date();
    }
}
```

You can find that the TIMEOUT is 9000,  but I got an Exception  and  it tell me 
the TIMEOUT is 1000.
```
Exception in thread "main" org.apache.dubbo.rpc.RpcException: Failed to invoke 
the method sayHello in the service com.example.studydubboApi.DemoService. Tried 
3 times of the providers [192.168.1.5:20880] (1/1) from the registry 
127.0.0.1:2181 on the consumer 192.168.1.5 using the dubbo version 
2.7.5-SNAPSHOT. Last error is: Invoke remote method timeout. method: sayHello, 
provider: 
dubbo://192.168.1.5:20880/com.example.studydubboApi.DemoService?anyhost=true&application=first-dubbo-consumer&check=false&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&interface=com.example.studydubboApi.DemoService&lazy=false&methods=sayHello&pid=20243&register.ip=192.168.1.5&release=2.7.5-SNAPSHOT&remote.application=first-dubbo-provider&side=consumer&sticky=false&timestamp=1571837759756,
 cause: org.apache.dubbo.remoting.TimeoutException: Waiting server-side 
response timeout by scan timer. start time: 2019-10-23 21:39:46.800, end time: 
2019-10-23 21:39:47.825, client elapsed: 5 ms, server elapsed
 : 1018 ms, timeout: 1000 ms, request: Request [id=2, version=2.0.2, 
twoway=true, event=false, broken=false, data=RpcInvocation 
[methodName=sayHello, parameterTypes=[class java.lang.String], 
arguments=[dubbo], attachments={path=com.example.studydubboApi.DemoService, 
remote.application=first-dubbo-consumer, 
interface=com.example.studydubboApi.DemoService, version=0.0.0}]], channel: 
/192.168.1.5:56619 -> /192.168.1.5:20880
        at 
org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:113)
        at 
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:248)
        at 
org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:78)
        at 
org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:55)
        at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java)
        at 
com.example.studydubboconsumer.ConsumerApplication.main(ConsumerApplication.java:20)
Caused by: java.util.concurrent.ExecutionException: 
org.apache.dubbo.remoting.TimeoutException: Waiting server-side response 
timeout by scan timer. start time: 2019-10-23 21:39:46.800, end time: 
2019-10-23 21:39:47.825, client elapsed: 5 ms, server elapsed: 1018 ms, 
timeout: 1000 ms, request: Request [id=2, version=2.0.2, twoway=true, 
event=false, broken=false, data=RpcInvocation [methodName=sayHello, 
parameterTypes=[class java.lang.String], arguments=[dubbo], 
attachments={path=com.example.studydubboApi.DemoService, 
remote.application=first-dubbo-consumer, 
interface=com.example.studydubboApi.DemoService, version=0.0.0}]], channel: 
/192.168.1.5:56619 -> /192.168.1.5:20880
        at 
java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
        at 
java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
        at 
org.apache.dubbo.rpc.protocol.AsyncToSyncInvoker.invoke(AsyncToSyncInvoker.java:56)
        at 
org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:78)
        at 
org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:92)
        at 
org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82)
        at 
org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54)
        at 
org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82)
        at 
org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:60)
        at 
org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82)
        at 
org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$CallbackRegistrationInvoker.invoke(ProtocolFilterWrapper.java:157)
        at 
org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56)
        at 
org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:82)
        ... 5 more
Caused by: org.apache.dubbo.remoting.TimeoutException: Waiting server-side 
response timeout by scan timer. start time: 2019-10-23 21:39:46.800, end time: 
2019-10-23 21:39:47.825, client elapsed: 5 ms, server elapsed: 1018 ms, 
timeout: 1000 ms, request: Request [id=2, version=2.0.2, twoway=true, 
event=false, broken=false, data=RpcInvocation [methodName=sayHello, 
parameterTypes=[class java.lang.String], arguments=[dubbo], 
attachments={path=com.example.studydubboApi.DemoService, 
remote.application=first-dubbo-consumer, 
interface=com.example.studydubboApi.DemoService, version=0.0.0}]], channel: 
/192.168.1.5:56619 -> /192.168.1.5:20880
        at 
org.apache.dubbo.remoting.exchange.support.DefaultFuture.doReceived(DefaultFuture.java:189)
        at 
org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:153)
        at 
org.apache.dubbo.remoting.exchange.support.DefaultFuture$TimeoutCheckTask.run(DefaultFuture.java:258)
        at 
org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
        at 
org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
        at 
org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
        at java.base/java.lang.Thread.run(Thread.java:834)
```
Is it an issue?

[ Full content available at: https://github.com/apache/dubbo/issues/5227 ]
This message was relayed via gitbox.apache.org for 
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to