Commit 29b61fd
Refactor JavaRuntimeParams and JavaRuntimeFactory, removing many unused command-line flags, remove jCommander dependency for simpler parser with simple types.
This change significantly refactors `JavaRuntimeParams` and `JavaRuntimeFactory`. Many command-line parameters have been removed from `JavaRuntimeParams` because they were unused.
The values for several parameters are now hardcoded as constants within `AppEngineConstants` and `JavaRuntimeFactory`, reflecting their static nature in the current runtime configuration.
Specifically, `MAX_RUNTIME_LOG_PER_REQUEST`, `BYTE_COUNT_BEFORE_FLUSHING`, `MAX_LOG_LINE_SIZE`, `MAX_LOG_FLUSH_TIME`, `THREAD_STOP_TERMINATES_CLONE`, `FORCE_URLFETCH_URL_STREAM_HANDLER`, `MAX_REQUEST_SIZE`, and `MAX_RESPONSE_SIZE` have been moved to `AppEngineConstants`.
Additionally, `LEGACY_MODE` and `ASYNC_MODE` in `AppEngineConstants` have been converted from static final fields to static methods (`isLegacyMode()` and `isAsyncMode()`). This allows their values to be dynamically read from system properties, which is necessary because `AppEngineConstants` is now used both before and after application loading, where system properties can change. This change fixes test failures in `AsyncServletTest`.
The command-line parsing library JCommander has been removed. A simpler manual parsing mechanism has been implemented in `JavaRuntimeParams` for the remaining four flags: `--trusted_host`, `--fixed_application_path`, `--jetty_http_port`, and `--clone_max_outstanding_api_rpcs`. Note that while `DEFAULT_MAX_OUTSTANDING_API_RPCS` is now defined in `AppEngineConstants`, the `--clone_max_outstanding_api_rpcs` flag still allows overriding this default.
The unused Cloud Profiler integration, previously configurable via `--enable_cloud_cpu_profiler` and `--enable_cloud_heap_profiler`, has been removed.
The selection of the `ServletEngineAdapter` is now based on system properties (`appengine.use.EE8`, `appengine.use.EE10`, or `appengine.use.EE11`) rather than a command-line parameter.
Other changes include:
* The system properties `appengine.jetty.also_log_to_apiproxy` and `appengine.urlfetch.deriveResponseMessage` are now unconditionally set to `true` in `JavaRuntimeFactory`.
* The `disable_api_call_logging_in_apiproxy` setting is now *only* controlled by the system property, removing its command-line parameter control.
* The constants `SKIP_ADMIN_CHECK_ATTR` and `X_GOOGLE_INTERNAL_SKIPADMINCHECK_UC` have been centralized in `AppEngineConstants`.
PiperOrigin-RevId: 868781401
Change-Id: Ib4e50d2fdd4946133e47713c320338e2617b65ec1 parent 3d89561 commit 29b61fd
29 files changed
Lines changed: 337 additions & 788 deletions
File tree
- runtime
- impl
- src/main/java/com/google/apphosting/runtime
- lite/src/main/java/com/google/appengine/runtime/lite
- local_jetty9/src/main/java/com/google/appengine/tools/development/jetty9
- runtime_impl_jetty121
- src/main/java/com/google/apphosting/runtime/jetty
- delegate/impl
- ee11
- ee8
- proxy
- runtime_impl_jetty12
- src/main/java/com/google/apphosting/runtime/jetty
- delegate/impl
- ee10
- ee8
- proxy
- runtime_impl_jetty9
- src
- main/java/com/google/apphosting/runtime/jetty9
- test/java/com/google/apphosting/runtime
- test/src/test/java/com/google/apphosting/runtime/jetty9
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
| 35 | + | |
39 | 36 | | |
40 | 37 | | |
41 | 38 | | |
| |||
Lines changed: 47 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
28 | | - | |
29 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
33 | 69 | | |
34 | 70 | | |
35 | 71 | | |
| |||
80 | 116 | | |
81 | 117 | | |
82 | 118 | | |
| 119 | + | |
| 120 | + | |
83 | 121 | | |
84 | 122 | | |
85 | 123 | | |
| |||
152 | 190 | | |
153 | 191 | | |
154 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
155 | 199 | | |
156 | 200 | | |
Lines changed: 59 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
19 | 30 | | |
20 | 31 | | |
| 32 | + | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
24 | | - | |
25 | | - | |
26 | 36 | | |
27 | 37 | | |
28 | 38 | | |
| |||
54 | 64 | | |
55 | 65 | | |
56 | 66 | | |
57 | | - | |
| 67 | + | |
58 | 68 | | |
59 | 69 | | |
60 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
61 | 73 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
71 | 81 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | | - | |
90 | | - | |
91 | | - | |
| 96 | + | |
| 97 | + | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
100 | 112 | | |
101 | | - | |
102 | | - | |
| 113 | + | |
103 | 114 | | |
104 | 115 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
108 | 119 | | |
109 | | - | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
113 | 124 | | |
114 | | - | |
| 125 | + | |
115 | 126 | | |
116 | 127 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
120 | 131 | | |
121 | 132 | | |
122 | 133 | | |
| |||
134 | 145 | | |
135 | 146 | | |
136 | 147 | | |
137 | | - | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | 151 | | |
| |||
145 | 156 | | |
146 | 157 | | |
147 | 158 | | |
148 | | - | |
149 | | - | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
170 | 181 | | |
171 | 182 | | |
172 | 183 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
178 | 193 | | |
| 194 | + | |
179 | 195 | | |
| 196 | + | |
| 197 | + | |
180 | 198 | | |
181 | 199 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 200 | + | |
204 | 201 | | |
205 | 202 | | |
206 | 203 | | |
0 commit comments