kazoo icon indicating copy to clipboard operation
kazoo copied to clipboard

Issue with KazooTimeout

Open BaranOrnarli opened this issue 4 years ago • 3 comments

I have an issue where Kazoo client timesout. I'm using Kazoo through a library called pysolr.

Here's a link to the source code line number:

https://github.com/django-haystack/pysolr/blob/cbb68d3905cf2aa7dc9b3100dd9ec959e10add18/pysolr.py#L1509

I am using default settings but I've also tried a timeout=12 (less than the zk.start() timeout just to test), and I'm still getting the problem.

  • Similar issue: https://github.com/python-zk/kazoo/issues/205
  • More recent issue: https://github.com/python-zk/kazoo/issues/517
  • Line in the code where exception is called (the exception I get): https://github.com/ralt/kazoo/blob/7aebefbf2e5a2048c425e6c784d41b1ec4c20936/kazoo/protocol/connection.py#L610

It's possible my host has intermittent connection issues but I don't see why the client won't handle it gracefully and just reconnect automatically like it implies in the "delay", "retry" parameters. Why does it just crash and stop trying?

I'm using Kazoo 2.6.1

BaranOrnarli avatar Mar 05 '20 18:03 BaranOrnarli

I am facing the same issue. It's further giving an OS error stating "too many files open"

netan-porwal avatar May 04 '20 13:05 netan-porwal

Have you confirmed you still experience the same issue with the latest release? There were fixed around timeouts in 2.7.x releases

Cheers

On Tue, Aug 4, 2020 at 8:17 AM Deepa12 [email protected] wrote:

netan-porwal Did you find any solution to the issue? I am also getting the same error.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/python-zk/kazoo/issues/593#issuecomment-668561124, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIFTHXVXOYAVIPEDXVNYK3R6736BANCNFSM4LCP2FMQ .

-- Charles-Henri de Boysson

ceache avatar Aug 04 '20 13:08 ceache

Had checked pysolr's internal code for this. It worked fine for me by closing the zookeeper object which is created in class Zookeeper in pyslor.py file. In the documentation it says the following:

**

For SolrCloud mode, initialize your Solr like this:

zookeeper = pysolr.ZooKeeper("zkhost1:2181,zkhost2:2181,zkhost3:2181") solr = pysolr.SolrCloud(zookeeper, "collection1", auth=) **

Try using this after creating the above object. solr.zookeeper.zk.stop() solr.zookeeper.zk.close()

If you check kazoo's documentation, it says to close the created kazoo session to free any resources held by the client. Kazoo Doc link: https://kazoo.readthedocs.io/en/latest/api/client.html

netan-porwal avatar Aug 05 '20 15:08 netan-porwal