community-libs / vaurien

TCP hazard proxy
https://vaurien.readthedocs.io
Other
379 stars 39 forks source link

redis protocol seems to have problems with delay behavior #38

Open crankycoder opened 10 years ago

crankycoder commented 10 years ago

I'm seeing this problem when using vaurien with mozilla ichnaea. gevent seems to be yelling at me, but I can see data going into my database -so the delay seems to be working - vaurien is just throwing messages to stderr or stdout for some reason.

I'm running vaurien with:

vaurien --proxy 0.0.0.0:9379  --backend 0.0.0.0:6379 --protocol redis --behavior 100:delay --behavior-delay-sleep 1

Here's the traceback:

Traceback (most recent call last):
  File "/Users/victorng/.virtualenvs/ichnaea/lib/python2.7/site-packages/gevent-1.0-py2.7-macosx-10.9-intel.egg/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/Users/victorng/.virtualenvs/ichnaea/lib/python2.7/site-packages/vaurien-1.8-py2.7.egg/vaurien/proxy.py", line 116, in handle
    res = [green.get() for green in greens]
  File "/Users/victorng/.virtualenvs/ichnaea/lib/python2.7/site-packages/gevent-1.0-py2.7-macosx-10.9-intel.egg/gevent/greenlet.py", line 274, in get
    raise self._exception
NotImplementedError
<Greenlet at 0x10185c0f0: <bound method RandomProxy.handle of <RandomProxy at 0x101822a90 fileno=5 address=0.0.0.0:9379>>(<socket at 0x101850ed0 fileno=[Errno 9] Bad file d, ('127.0.0.1', 49621))> failed with NotImplementedError
shreyagarwal commented 6 years ago

Was this solved ?. I am getting the same error

shreyagarwal commented 6 years ago

Redis protocol doesnt work for me, so I used TCP, seems to be working with redis

$ vaurien --proxy 0.0.0.0:6378 --backend 0.0.0.0:6379 --stay-connected --behavior 100:delay --behavior-delay-sleep 1 --protocol-tcp-keep-alive

For 1 sec delay in vaurien it actually induces a 2sec delay in redis