vert-x3 / vertx-consul-client

Vert.x Consul Client
Apache License 2.0
34 stars 23 forks source link

Watch key value timeout #70

Closed phamtai97 closed 4 years ago

phamtai97 commented 4 years ago

Hi @vietj I use the feature to Watch key value for my project. Then, I have timeout problem when i watch key-value. I set timeout for a request is 10s. This is error:

io.vertx.core.http.impl.HttpClientRequestBase$1: The timeout period of 10000ms has been exceeded while executing GET /v1/kv/xxxxxx?wait=10m&index=226870

My code:

  Watch<KeyValue> watch = Watch.key(key, this.vertx, this.consulClientOptions);

    watch
        .setHandler(
            res -> {
              if (res.succeeded()) {
                if (ValidateUtil.notNull(res.prevResult())) {
                  callback.onChange(res.nextResult().getKey(), res.nextResult().getValue());
                }
              } else {
                LOGGER.error(res.cause());
              }
            })
        .start();

Can you help me explain this problem?

ruslansennov commented 4 years ago

Hi @phamtai97 I guess you set ConsulOptions's timeout to 10s which is less than blocking awaiting time. In this case, you will receive such errors along with successful events, and this is expected behavior. The bad news: after each timeout error, each next resubscribing will be invoked with a progressive delay (up to 180s). I believe we should ignore all timeout exceptions with resubscribing without any delay. I'll prepare a patch soon.

phamtai97 commented 4 years ago

Thank you @ruslansennov. I can not set ConsulOptiont's timeout too hight. Because I also call Consul for other APIs.

phamtai97 commented 4 years ago

@ruslansennov Which version did you release?

ruslansennov commented 4 years ago

it will be 4.0.0

phamtai97 commented 4 years ago

But In version > 3.8, Some api of vertx have been changed. I think we only need have patch version such as 3.7.3.

VoxT commented 4 years ago

Same issue too. We are using vertx 3.7.1 in production and have to upgrade to version 4.0.0 with a bunch of change is not reasonable. Can you provide a patch version ?

Thank you.

phamtai97 commented 4 years ago

@ruslansennov help me !!!. thanks

ruslansennov commented 4 years ago

@vietj are there any plans to release version 3.8.6?

phamtai97 commented 4 years ago

Oh @ruslansennov , I think that we only need a patch version less V3.8.

ruslansennov commented 4 years ago

i'm afraid it is impossible

ruslansennov commented 4 years ago

cherry-picked to 3.9 branch

ruslansennov commented 4 years ago

cherry-picked to 3.8 branch