Giter VIP home page Giter VIP logo

beaker_extensions's People

Contributors

andrewzeneski avatar bbangert avatar dairiki avatar demostenes avatar didip avatar esteve avatar hanula avatar iuridiniz avatar kyleterry avatar natej avatar shazow avatar virhilo avatar xiaonuogantan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

beaker_extensions's Issues

Redis leaks connections

Hi,
If i do not specify a connection pool, then connections are leaked continuously until you hit the max open files limit, at which point redis uses 100% of cpu and silently fails unless debug is set. The latest version of redis has fixed the silent nature of the failure.

testing with ab -n 1000 -c 10 the connection count climbs and doesn't fall until they time out.

netstat -tn|grep 6379|wc -l
6008
netstat -tn|grep 6379|wc -l
8009

if i specify a pool:

def setup_redis_session(app):
redis_pool = redis.ConnectionPool(host='localhost', port=6379, db=0)
return SessionMiddleware(app, type="redis", url="localhost:6379", key="musicfilmcomedy", connection_pool=redis_pool)

after many requests:
netstat -tn|grep 6379|wc -l
10
netstat -tn|grep 6379|wc -l
13
netstat -tn|grep 6379|wc -l
8

I tested with uwsgi and cherrypy. I'm using the latest git code.

NoSqlManager. get_creation_lock issue

Current NoSqlManager.get_creation_lock doesn't take into account key, which leads to deadlocks in some situations. A possible fixture is:

    def get_creation_lock(self, key):
        return file_synchronizer(
            identifier ="tccontainer/funclock/%s/%s" % (self.namespace, key),
            lock_dir = self.lock_dir)

Bug in the redis __contains__ method

contains in the redis method appears to format the key twice, so when beaker tries to look up something that should have been:

beaker:AutoJunction:Advert:AdvertMastShort:23

it asks for:

beaker:AutoJunction:Advert:beaker:AutoJunction:Advert:AdvertMastShort:23

which results in a cache miss.

I'm not sure how to submit a patch, but the fix appears to be pretty easy.

Change:

def __contains__(self, key):
    key = self._format_key(key)
    return self.db_conn.exists(self._format_key(key))

to:

def __contains__(self, key):
    return self.db_conn.exists(self._format_key(key))

which is actually how all the other extensions seem to do it anyway.

Update pypi and tag releases

The latest version on pypi is 0.1.1dev. Please update pypi with the latest. If not maintaining pypi, then remove it so no one is confused about the old version.

Also can you create tags for every version? If we must use git for latest version, then we need a way to pin to that specific version for our deployment.

Python3

I've got this running for python 3.3. The only changes I had to make were in ringogw.py, changing one except a,b to except a as b, and two prints.

redis key info is essentially backwards

so there is this bit in redis_.py

def _format_key(self, key):
    return 'beaker:%s:%s' % (self.namespace, key.replace(' ', '\302\267'))

That generates a key like this:

beaker:f1d17960690c49a9807e5b4c2e29afd3:session

but one might expect

beaker:session:f1d17960690c49a9807e5b4c2e29afd3

If this was intended, there should be a note to let people know how/where to look for their data.

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.