Comment 2 for bug 994609

Revision history for this message
Patrick Mezard (pmezard) wrote :

Selecting "poll" was hardcoded by:

------------
commit e893b248a2f541eb8409c552b17b43c67430d117
Author: Stuart McLaren <email address hidden>
Date: Tue Dec 20 18:03:55 2011 +0000

    Multi-process Glance API server support.

    Implements blueprint multi-process-server. Allows several Glance API
    worker processes to be started, which can increase performance on machines
    with more than one CPU.

    Change-Id: I1cbb48945fd23afd71de3a30b80836b590c023a1
------------

I have no idea what kind of load is expected on glance-api, but if Stuart spent time making it multi-process I suppose this is not negligible. So I would avoid the "pick whatever is there" solution as people may rely on "poll" performance profile, and could be surprised if something else is picked. What about:

- introduce a DEFAULT.eventlet_hub configuration entry to allow explicit hub selection, defaulting to "poll"
- extend DEFAULT.eventlet_hub values to include "auto" for convenience, which would pick what is available. Could be used at least for tests if people are not interested in eventlet details.
- find a way to communicate "eventlet_hub" from the test environment. I had a solution using a GLANCE_TEST_EVENTLET_HUB environment variable, if it can be done with a test configuration file I would prefer that but I could not find anything like it.
- make FunctionalTest.wait_for_servers() suggest to use GLANCE_TEST_EVENTLET_HUB when failing on timeout and an eventlet error message appear in the logs (this is fragile, depends on the error string/localization), but still can save time for newcomers like me.

What do you think?