]> scripts.mit.edu Git - wizard.git/commitdiff
Add hack to get around AFS rate limiting.
authorEdward Z. Yang <ezyang@mit.edu>
Sat, 26 Nov 2011 04:46:13 +0000 (23:46 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Sat, 26 Nov 2011 04:46:13 +0000 (23:46 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
bin/wizard

index 95fbec429c40cfa6e271dec185c5afb5a39b401d..d652d19ba5eace4d7311b63d8268dfd7c9d3e4c5 100755 (executable)
@@ -114,6 +114,14 @@ See '%prog help COMMAND' for more information on a specific command."""
             parser.print_help()
             sys.exit(1)
         help_module.main(['--help'], baton)
+    # This is a gigantic hack to handle the case of AFS + Scripts style
+    # permissions, where we usually don't have access to the HOME
+    # directory.  AFS will throttle you if you trigger too many
+    # lack of permissions, and since we run Git a lot and Git
+    # persistently stats the home directory, this can cause pretty
+    # big problems for our performance.
+    if not os.access(os.environ['HOME'], os.R_OK):
+        os.putenv('HOME', '/disabled')
     # Dispatch commands
     command_module = get_command(command_name)
     try: