Comment 9 for bug 1227575

Revision history for this message
Aswad Rangnekar (aswad-r) wrote :

I am working on this patch and have 2 solutions discussed below. Both use sessions to maintain vnc session information/instance.
I would like to have opinions if either of the solution looks feasible

A session is maintained throughout a connection between vnc user and a given instance.
e.g.

console_sessions = {
<instance_1_UUID>: [session_1_UUID, session_2_UUID, session_3_UUID........],
<instance_1_UUID>: [session_1_UUID, session_2_UUID, session_3_UUID........],
...
...
}

Solution 1: Uses multiprocessing.Manager().dict() for vnc session management
Advantages:
- session information is stored in-memory
Disadvantages:
- Methods start_server(), top_new_client() and new_client() from websockify.WebSocketProxy class
  has to be overridden.

Problem faced - *Please suggest a workaround or an alternative *
I get an exception as shown below while using multiprocessing.Manager().dict().
Assuming that this error is caused because socket module is being monkeypatched by eventlet.
Referred:
http://stackoverflow.com/questions/14736766/why-does-gevent-socket-break-multiprocessing-connections-auth
https://groups.google.com/forum/#!msg/ruffus_discuss/kzXcedlRwuQ/ag3mKlc7B-0Js

n-novnc log:

Traceback (most recent call last):
File "/usr/local/bin/nova-novncproxy", line 10, in <module>
sys.exit(main())
File "/opt/stack/nova/nova/cmd/novncproxy.py", line 89, in main
server.start_server()
File "/opt/stack/nova/nova/console/websocketproxy.py", line 124, in start_server
d = manager.Namespace()
File "/usr/lib/python2.7/multiprocessing/managers.py", line 667, in temp
token, exp = self._create(typeid, *args, **kwds)
File "/usr/lib/python2.7/multiprocessing/managers.py", line 565, in _create
conn = self._Client(self._address, authkey=self._authkey)
File "/usr/lib/python2.7/multiprocessing/connection.py", line 175, in Client
answer_challenge(c, authkey)
File "/usr/lib/python2.7/multiprocessing/connection.py", line 413, in answer_challenge
connection.recv_bytes()
IOError: [Errno 11] Resource temporarily unavailable

Solution 2: Use external store, sqlite or memcache for vnc session management
Disadvantages:
- new_client method from websockify.WebSocketProxy class must be overridden.
- It might be an overhead
- Managing and monitoring memcache on comput node will be an overhead for administrator.
- new_client method from websockify.WebSocketProxy class must be overridden.