diff options
author | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-05-29 18:41:18 +0000 |
---|---|---|
committer | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-05-29 18:41:18 +0000 |
commit | 96c13fcf9c9b2de0e3a89a794e2ea26a0226a24c (patch) | |
tree | 67d099c4d0b94b7b2cf3cea6f66b1d16e5d1b467 /scheduler | |
parent | db160d1478cded4807556f6b42a2f6dae4c3e42a (diff) |
make the readonly connection fallback to the regular Django connection when running in the scheduer. this is really important, because otherwise the readonly connection is not autocommit and bad, bad things could happen, though i'm not sure exactly what existing problems there might have been. we used to do this only for testing, but since we do it in another context here, i renamed the method to be more generic and appropriate.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3183 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'scheduler')
-rwxr-xr-x | scheduler/monitor_db.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scheduler/monitor_db.py b/scheduler/monitor_db.py index 64dcdc5e..3c9948ef 100755 --- a/scheduler/monitor_db.py +++ b/scheduler/monitor_db.py @@ -14,7 +14,7 @@ from autotest_lib.frontend import setup_django_environment from autotest_lib.client.common_lib import global_config from autotest_lib.client.common_lib import host_protections, utils from autotest_lib.database import database_connection -from autotest_lib.frontend.afe import models, rpc_utils +from autotest_lib.frontend.afe import models, rpc_utils, readonly_connection from autotest_lib.scheduler import drone_manager, drones, email_manager from autotest_lib.scheduler import monitor_db_cleanup from autotest_lib.scheduler import status_server, scheduler_config @@ -196,6 +196,8 @@ def init(logfile): # ensure Django connection is in autocommit setup_django_environment.enable_autocommit() + # bypass the readonly connection + readonly_connection.ReadOnlyConnection.set_globally_disabled(True) logging.info("Setting signal handler") signal.signal(signal.SIGINT, handle_sigint) |