Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kazoo hangs in uwsgi #538

Open
rhyspang opened this issue Nov 20, 2018 · 3 comments
Open

kazoo hangs in uwsgi #538

rhyspang opened this issue Nov 20, 2018 · 3 comments

Comments

@rhyspang
Copy link

I use uwsgi to start django application, which call start method in kazoo client instance to connect zookeeper server, it hangs. even if I use --enable-threads . Exception traceback as follow, could you give me some advise, thanks a lot!

self._zk.start(timeout=timeout)
  File "/Users/rhys/.local/share/virtualenvs/dialog-Pn4M1tPm/lib/python2.7/site-packages/kazoo/client.py", line 559, in start
    self.stop()
  File "/Users/rhys/.local/share/virtualenvs/dialog-Pn4M1tPm/lib/python2.7/site-packages/kazoo/client.py", line 613, in stop
    self._safe_close()
  File "/Users/rhys/.local/share/virtualenvs/dialog-Pn4M1tPm/lib/python2.7/site-packages/kazoo/client.py", line 506, in _safe_close
    if not self._connection.stop(timeout):
  File "/Users/rhys/.local/share/virtualenvs/dialog-Pn4M1tPm/lib/python2.7/site-packages/kazoo/protocol/connection.py", line 180, in stop
    self.connection_stopped.wait(timeout)
  File "/Users/rhys/.pyenv/versions/2.7.15/lib/python2.7/threading.py", line 614, in wait
    self.__cond.wait(timeout)
  File "/Users/rhys/.pyenv/versions/2.7.15/lib/python2.7/threading.py", line 359, in wait
    _sleep(delay)
@StephenSorriaux
Copy link
Member

StephenSorriaux commented Nov 20, 2018

Hi,

Sounds similar to #536

What version of Kazoo are you using? Zookeeper? What value of timeout are you passing? Have you got any logs on Zookeeper's side that can explain the timeout?

@rhyspang
Copy link
Author

Hi,

Sounds similar to #536

What version of Kazoo are you using? Zookeeper? What value of timeout are you passing? Have you got any logs on Zookeeper's side that can explain the timeout?

kazoo==2.5.0
timeout = 3.0

There is no log in Zookepper's side. Everything is ok when I start my django application using python manage.py runserver, but with uwsgi run, it hangs in start() method of kazoo client instance,

@StephenSorriaux
Copy link
Member

StephenSorriaux commented Nov 27, 2018

Can you give us more details about your app? How did you create your thread? How are you launching your uswgi?

I tried using python 2.7.15, and:

(venv) stephen@somewhere:~/dev/temp/mysite$ pip list
Package    Version 
---------- --------
Django     1.11.16 
kazoo      2.6.0   
pip        18.1    
pytz       2018.7  
setuptools 40.6.2  
six        1.11.0  
uWSGI      2.0.17.1
wheel      0.32.3  

I launch uwsgi using uwsgi --http :8000 --module mysite.wsgi --enable-threads and the thread is correctly running.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants