OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from branch_utility import BranchUtility | 5 from branch_utility import BranchUtility |
6 from compiled_file_system import CompiledFileSystem | 6 from compiled_file_system import CompiledFileSystem |
7 from environment import IsDevServer, IsReleaseServer | 7 from environment import IsDevServer, IsReleaseServer |
8 from github_file_system_provider import GithubFileSystemProvider | 8 from github_file_system_provider import GithubFileSystemProvider |
9 from host_file_system_provider import HostFileSystemProvider | 9 from host_file_system_provider import HostFileSystemProvider |
10 from third_party.json_schema_compiler.memoize import memoize | 10 from third_party.json_schema_compiler.memoize import memoize |
11 from render_servlet import RenderServlet | 11 from render_servlet import RenderServlet |
12 from object_store_creator import ObjectStoreCreator | 12 from object_store_creator import ObjectStoreCreator |
13 from server_instance import ServerInstance | 13 from server_instance import ServerInstance |
14 from gcs_file_system_provider import CloudStorageFileSystemProvider | 14 from gcs_file_system_provider import CloudStorageFileSystemProvider |
15 | 15 |
16 class InstanceServletRenderServletDelegate(RenderServlet.Delegate): | 16 class InstanceServletRenderServletDelegate(RenderServlet.Delegate): |
17 '''AppEngine instances should never need to call out to SVN. That should only | 17 '''AppEngine instances should never need to call out to SVN. That should only |
18 ever be done by the cronjobs, which then write the result into DataStore, | 18 ever be done by the cronjobs, which then write the result into DataStore, |
19 which is as far as instances look. To enable this, crons can pass a custom | 19 which is as far as instances look. To enable this, crons can pass a custom |
20 (presumably online) ServerInstance into Get(). | 20 (presumably online) ServerInstance into Get(). |
21 | 21 |
22 Why? SVN is slow and a bit flaky. Cronjobs failing is annoying but temporary. | 22 Why? SVN is slow and a bit flaky. Refresh jobs failing is annoying but |
ahernandez
2014/09/15 23:58:02
Could you please changes instances of SVN to Gitil
Ken Rockot(use gerrit already)
2014/09/16 00:24:31
Done.
| |
23 Instances failing affects users, and is really bad. | 23 temporary. Instances failing affects users, and is really bad. |
24 | 24 |
25 Anyway - to enforce this, we actually don't give instances access to SVN. If | 25 Anyway - to enforce this, we actually don't give instances access to SVN. If |
26 anything is missing from datastore, it'll be a 404. If the cronjobs don't | 26 anything is missing from datastore, it'll be a 404. If the cronjobs don't |
27 manage to catch everything - uhoh. On the other hand, we'll figure it out | 27 manage to catch everything - uhoh. On the other hand, we'll figure it out |
28 pretty soon, and it also means that legitimate 404s are caught before a round | 28 pretty soon, and it also means that legitimate 404s are caught before a round |
29 trip to SVN. | 29 trip to SVN. |
30 ''' | 30 ''' |
31 def __init__(self, delegate): | 31 def __init__(self, delegate): |
32 self._delegate = delegate | 32 self._delegate = delegate |
33 | 33 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 return GithubFileSystemProvider(object_store_creator) | 69 return GithubFileSystemProvider(object_store_creator) |
70 | 70 |
71 @staticmethod | 71 @staticmethod |
72 def GetConstructor(delegate_for_test=None): | 72 def GetConstructor(delegate_for_test=None): |
73 render_servlet_delegate = InstanceServletRenderServletDelegate( | 73 render_servlet_delegate = InstanceServletRenderServletDelegate( |
74 delegate_for_test or InstanceServlet.Delegate()) | 74 delegate_for_test or InstanceServlet.Delegate()) |
75 return lambda request: RenderServlet(request, render_servlet_delegate) | 75 return lambda request: RenderServlet(request, render_servlet_delegate) |
76 | 76 |
77 # NOTE: if this were a real Servlet it would implement a Get() method, but | 77 # NOTE: if this were a real Servlet it would implement a Get() method, but |
78 # GetConstructor returns an appropriate lambda function (Request -> Servlet). | 78 # GetConstructor returns an appropriate lambda function (Request -> Servlet). |
OLD | NEW |