Skip to content

Resolve "test: gevent thread exception is back"

Wout De Nolf requested to merge 2259-test-gevent-thread-exception-is-back into master

Closes #2259 (closed)

  • Redis connections created with single_connection_client=True were not all closed by clean_all_redis_connection (in addition single connections and reusable connections were stored in the same dict so you could in principle end up reusing a single connection)

  • Added tests for Redis connection cleanup (introduced clean_socket in analogy to clean_gevent)

  • Change the modbus server from the test suite from threaded (yikes) to subprocess

  • Add some docstrings to the Beacon connection class + minor refactoring/renaming of internals (the words "connection" and "pool" should be chosen with care)

  • What we called a Redis connection is not a Redis connection, it is a proxy (like tango's DeviceProxy). Refactor to make that clear:

    • get_redis_proxy: returns SafeRedisDbProxy
    • get_fixed_connection_redis_proxy: returns FixedConnectionRedisDbProxy
    • get_redis_connection: returns redis.Redis (DEPRECATED)

    This is applied to bliss.config.conductor.connection.Connection and bliss.config.conductor.client.

  • The new redis_connection.py module removes the Redis logic from connection.py which is for the Beacon connection. For example this is more or less what Connection.get_redis_proxy does (without the caching and cleanup sugar):

    from bliss.config.conductor.redis_connection import create_connection_pool
    pool = create_connection_pool("redis://localhost:25002", db=1)
    rdb_proxy = pool.create_proxy()
    # The proxy provides an API for Redis commands:
    print(rdb_proxy.keys())
Edited by Wout De Nolf

Merge request reports