gevent exception (cannot switch to a different thread): SCAN_SAVING
Reproduce the error:
- Start the demo servers:
python demo/start_demo_servers.py
- Start the BLISS shell:
TANGO_HOST=localhost:10000 BEACON_HOST=localhost:10001 bliss -s demo_session
- Type this:
DEMO [1] SCAN_SAVING.proposal.name
19/04/2021 15:45:57 Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/denolf/dev/bliss/bliss/scanning/scan_saving.py", line 89, in eval_func
self._update_eval_dict(eval_dict)
File "/home/denolf/dev/bliss/bliss/scanning/scan_saving.py", line 235, in _update_eval_dict
self.get_cached_property(prop, eval_dict)
File "/home/denolf/dev/bliss/bliss/scanning/scan_saving.py", line 266, in get_cached_property
r = _prop.fget(self)
File "/home/denolf/dev/bliss/bliss/config/settings.py", line 1904, in last_accessed
idletime = self._proxy.connection.object("idletime", key_name)
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/client.py", line 1352, in object
return self.execute_command('OBJECT', infotype, key, infotype=infotype)
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/client.py", line 901, in execute_command
return self.parse_response(conn, command_name, **options)
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/client.py", line 915, in parse_response
response = connection.read_response()
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/connection.py", line 730, in read_response
response = self._parser.read_response()
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/connection.py", line 464, in read_response
self.read_from_socket()
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/connection.py", line 421, in read_from_socket
bufflen = recv_into(self._sock, self._buffer)
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/redis/_compat.py", line 75, in recv_into
return sock.recv_into(*args, **kwargs)
File "/users/denolf/virtualenvs/bliss/ubuntu_20_04/lib/python3.7/site-packages/gevent/_socketcommon.py", line 693, in recv_into
self._wait(self._read_event)
File "src/gevent/_hub_primitives.py", line 317, in gevent._gevent_c_hub_primitives.wait_on_socket
File "src/gevent/_hub_primitives.py", line 322, in gevent._gevent_c_hub_primitives.wait_on_socket
File "src/gevent/_hub_primitives.py", line 304, in gevent._gevent_c_hub_primitives._primitive_wait
File "src/gevent/_hub_primitives.py", line 46, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
File "src/gevent/_hub_primitives.py", line 46, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
File "src/gevent/_hub_primitives.py", line 55, in gevent._gevent_c_hub_primitives.WaitOperationsGreenlet.wait
File "src/gevent/_waiter.py", line 154, in gevent._gevent_c_waiter.Waiter.get
File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 61, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_greenlet_primitives.py", line 65, in gevent._gevent_c_greenlet_primitives.SwitchOutGreenletWithLoop.switch
File "src/gevent/_gevent_c_greenlet_primitives.pxd", line 35, in gevent._gevent_c_greenlet_primitives._greenlet_switch
greenlet.error: cannot switch to a different thread
This means that the shared Redis connection pool contains connections (sockets) which are created in a different thread than the main thread.