pierresouchay / consul-rust

Rust client libray for Consul HTTP API
Apache License 2.0
93 stars 48 forks source link

consul_client.catalog.get_nodes throws "Pooled stream disconnected" #14

Closed SkeLLLa closed 5 years ago

SkeLLLa commented 7 years ago

I've found strange bug in "master" branch, but as far as I can see the same method is used in refactor branch, so probably it will be affected too.

The thing is that if I call consul_client.catalog.get_nodes method several times with pauses more than 30 seconds, every second call will "throw" error "Pooled stream disconnected".

Something like that

            loop {
                ...
                consul_client.catalog.get_nodes();
                std::thread::sleep(std::time::Duration::from_millis(30000));
            }

If I set this interval to 29 seconds, for example, the error is gone. I don't know what is this, probably it's related to keep-alive somehow.

stusmall commented 7 years ago

Master is in very poor shape. I'm working on a refactor but don't want to replace master with it until I'm caught up with features. I'd highly suggest using it instead: https://github.com/stusmall/consul-rust/tree/refactor

stusmall commented 5 years ago

In updating to newer HTTP client libraries I believe this issue has been fixed. Please reopen if you see it again on 0.3.0