Giter VIP home page Giter VIP logo

Comments (7)

sighingnow avatar sighingnow commented on June 26, 2024

You mean, after successfully creating a set of watchers, they works and expected and the next new watcher hangs in its constructor?

from etcd-cpp-apiv3.

sighingnow avatar sighingnow commented on June 26, 2024

I'm not sure what happens in the details, but could you please try to create every new watcher with a new client?

Creating watcher from established client will reuse the underlying gRPC channel.

from etcd-cpp-apiv3.

sighingnow avatar sighingnow commented on June 26, 2024

It never should hang, though. Could you please provide me a simplified test program to reproduce?

from etcd-cpp-apiv3.

rockeet avatar rockeet commented on June 26, 2024

It never should hang, though. Could you please provide me a simplified test program to reproduce?

Our code snippet are as below:

// read {url, ca, cert, key} from config
auto pEtcd = new etcd::Client(url, ca, cert, key, "round_robin");
//
// if we use insecure etcd::Client, it will not hang
// auto pEtcd = new etcd::Client(url, "round_robin");
//
// some code, the belowing code run in multi threads, and pEtcd is shared
// in these multi threads
//
while (SomeCondition) {
   std::atomic<bool> done{false};
   etcd::Response response;
   auto callback = [&](etcd::Response&& resp_task) {
      response = std::move(resp_task);
      done.store(true);
   };
   int from_index = 0;
   std::string watch_key = DifferentOnEachLoop();
   // here, after several successful construction, later construction hang
   etcd::Watcher watcher(*pEtcd, watch_key, from_index, callback);
   //
   // some code
   //
  pEtcd->rm(watch_key);
}

from etcd-cpp-apiv3.

sighingnow avatar sighingnow commented on June 26, 2024

I can reproduce the issue, but have no idea about what's going wrong, and don't have enough time to investigate currently.

To workaround the issue, you could issue a new client everything you creating a watcher.

from etcd-cpp-apiv3.

rockeet avatar rockeet commented on June 26, 2024

I can reproduce the issue, but have no idea about what's going wrong, and don't have enough time to investigate currently.

To workaround the issue, you could issue a new client everything you creating a watcher.

Yes, we have worked around this issue, we are also expecting the fix.

from etcd-cpp-apiv3.

yess1987 avatar yess1987 commented on June 26, 2024

ca, cert, key 可以直接使用k8s给etcd生成的密钥文件吗

from etcd-cpp-apiv3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.