If app A uses gr.Interface.load() to load an app B that contains a your_app.launch(enable_queue=True), the queue does not get respected when the app B is executed from the app A. So if there are 3 app A users, and all trigger app B at the same time, app B runs 3x in parallel, regardless if enable_queue was set to True on app B.
This implies in two things:
- Any person can bypass the app B queue by using app A
- The host machine of app B may OOM if multiple users are running it from app A, as no queue is in place
This can currently be mitigated by adding a enable_queue=True to app A however this two shortcomings:
- app A developer has to have the goodwill to include the queuing function there (including using
gr.Interface.load() privately via localhost - which can be an easy way to bypass any queue), if they don't, app B gets resource drained outside of their control
- This makes app A inefficient. Suppose app A not only loads app B but also loads apps C and D with
gr.Interface.load(). If enable_queue is on app A, now when you call apps B, C, D from it, they get into the same queue, even though each could have very different internal queues (this happens with MindsEye Lite)
Suggested solution:
- Add the app A users that are calling app B to the same queue as native app B users
If that gets implemented make sure to de-register from app B's queue the users that leave/give up on app A too, otherwise an infinite queue could arise
If app A uses
gr.Interface.load()to load an app B that contains ayour_app.launch(enable_queue=True), the queue does not get respected when the app B is executed from the app A. So if there are 3 app A users, and all trigger app B at the same time, app B runs 3x in parallel, regardless ifenable_queuewas set toTrueon app B.This implies in two things:
This can currently be mitigated by adding a
enable_queue=Trueto app A however this two shortcomings:gr.Interface.load()privately via localhost - which can be an easy way to bypass any queue), if they don't, app B gets resource drained outside of their controlgr.Interface.load(). Ifenable_queueis on app A, now when you call apps B, C, D from it, they get into the same queue, even though each could have very different internal queues (this happens with MindsEye Lite)Suggested solution:
If that gets implemented make sure to de-register from app B's queue the users that leave/give up on app A too, otherwise an infinite queue could arise