LXC-Web-Panel icon indicating copy to clipboard operation
LXC-Web-Panel copied to clipboard

Multithreading support

Open lukasraska opened this issue 9 years ago • 2 comments

Currently, Flask is running in single thread, hence access from different places is not possible if there is some container operation.

Possible implementations:

  1. Start Flask with "threaded=True" option
  2. Dedicate extra thread to LXC API access
  3. Asynchronous LXC API (if possible)

Option 1 seems to be working fine, but some testing needs to be done (especially testing If LXC api is threadsafe - for example multiple container creation at the same time). Option 2 can be used if option 3 isn't possible (either new thread for every LXC request or one thread with thread-safe queue)

Combination of 1 and 2 seems to be efficient and safe even if LXC API cannot be accessed in threaded way (single thread-safe queue with one worker also handles concurrency -> for example deletion of container that is currently in process of creation)

lukasraska avatar Feb 03 '15 14:02 lukasraska

Since LXC API is for Python 3 (i guess) and API here uses subprocesses, it could create concurrent issue situation (e.g. starting container before it's created)

TBD: add backup action into queue, refactor it a bit, display processed items / items in queue

lukasraska avatar Feb 03 '15 16:02 lukasraska

Hey @DarkKnightCZ which is the status of this branch? There are missing features of the code that need further rework or it is ready to be merged?

claudyus avatar Mar 12 '15 21:03 claudyus