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

Add Support For Connection Pool #64

Open
t2othick opened this issue Feb 17, 2016 · 0 comments
Open

Add Support For Connection Pool #64

t2othick opened this issue Feb 17, 2016 · 0 comments
Labels

Comments

@t2othick
Copy link

When I use beanstalkc with gevent, I hit the error

[E 160217 14:26:01 event:37 f5e11774ac61efb21a5b9e64006c544d:10] This socket is already used by another greenlet: <bound method Waiter.switch of <gevent.hub.Waiter object at 0x7fe0e514fc30>>
Traceback (most recent call last):
File "/data/apps/owl/owl/api/event.py", line 35, in create_event
beanstalk.put(job)
File "/data/apps/owl/owl/beanstalk.py", line 58, in put
self._conn.put(json_encode(job), delay=delay)
File "/data/apps/owl/eggs/beanstalkc-0.4.0-py2.7.egg/beanstalkc.py", line 136, in put
['INSERTED'], ['JOB_TOO_BIG','BURIED','DRAINING'])
File "/data/apps/owl/eggs/beanstalkc-0.4.0-py2.7.egg/beanstalkc.py", line 110, in _interact_value
return self._interact(command, expected_ok, expected_err)[0]
File "/data/apps/owl/eggs/beanstalkc-0.4.0-py2.7.egg/beanstalkc.py", line 87, in _interact
status, results = self._read_response()
File "/data/apps/owl/eggs/beanstalkc-0.4.0-py2.7.egg/beanstalkc.py", line 96, in _read_response
line = SocketError.wrap(self._socket_file.readline)
File "/data/apps/owl/eggs/beanstalkc-0.4.0-py2.7.egg/beanstalkc.py", line 41, in wrap
return wrapped_function(_args, *_kwargs)
File "/usr/local/lib/python2.7/socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
File "/data/apps/owl/eggs/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/socket.py", line 394, in recv
self._wait(self._read_event)
File "/data/apps/owl/eggs/gevent-1.0.2-py2.7-linux-x86_64.egg/gevent/socket.py", line 294, in _wait
assert watcher.callback is None, 'This socket is already used by another greenlet: %r' % (watcher.callback, )
AssertionError: This socket is already used by another greenlet: <bound method Waiter.switch of <gevent.hub.Waiter object at 0x7fe0e514fc30>>

I think we can add a threading-safe connection pool to solve it, thanks

@earl earl added the wish label Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants