2 * Copyright (c) 2015, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
17 | No_server_running_should_retry
18 | Server_hung_up_should_retry
19 | Server_hung_up_should_abort
22 | Server_already_exists
25 | Monitor_connection_failure
32 (** An uncaught Not_found exception in the worker. *)
33 | Worker_not_found_exception
34 | Worker_failed_to_send_job
40 | EventLogger_restart_out_of_retries
41 | EventLogger_broken_pipe
44 (** It is faster to exit the server (and have the Monitor restart the server)
45 * on a Watchman fresh instance than to compute the files that have been
46 * deleted and do an incremental check.
48 | Watchman_fresh_instance
49 | Watchman_invalid_result
53 | Server_shutting_down
54 | IDE_malformed_request
59 | IDE_typechecker_died
60 | Redecl_heap_overflow
61 | Out_of_shared_memory
62 | Shared_mem_assertion_failure
64 | IDE_new_client_connected
67 | Parser_heap_build_error
69 | Sql_assertion_failure
70 | Local_type_env_stale
77 | Failed_to_load_should_retry
78 | Failed_to_load_should_abort
80 exception Exit_with
of t
82 let exit_code = function
85 | Build_terminated
-> 1 (* used in clientBuild *)
86 | Kill_error
-> 1 (* used in clientStop/Start/Restart *)
87 | Server_shutting_down
-> 1 (* used in server *)
88 | Build_error
-> 2 (* used in clientBuild *)
89 | Type_error
-> 2 (* used in clientCheck *)
90 | Uncaught_exception
-> 2 (* used in server and clientIde *)
91 | Hhconfig_changed
-> 4
93 | No_server_running_should_retry
-> 6 (* gen by clientConnect, read by find_hh.sh *)
94 | Server_hung_up_should_retry
-> 6 (* gen by clientConnect, read by find_hh.sh *)
97 | Checkpoint_error
-> 8
98 | Build_id_mismatch
-> 9
99 | Monitor_connection_failure
-> 9
102 | Lost_parent_monitor
-> 12
103 | Shared_mem_assertion_failure
-> 14
104 | Out_of_shared_memory
-> 15
105 | Hash_table_full
-> 16
109 | Worker_not_found_exception
-> 32
110 | Worker_failed_to_send_job
-> 33
111 | Server_already_exists
-> 77
115 | Dfind_unresponsive
-> 100
116 | EventLogger_Timeout
-> 101
118 | Watchman_failed
-> 103
119 | Hhconfig_deleted
-> 104
120 | EventLogger_broken_pipe
-> 106
121 | Redecl_heap_overflow
-> 107
122 | EventLogger_restart_out_of_retries
-> 108
123 | Watchman_fresh_instance
-> 109
124 | Watchman_invalid_result
-> 110
125 | Big_rebase_detected
-> 111
126 | IDE_malformed_request
-> 201
127 | IDE_no_server
-> 202
128 | IDE_out_of_retries
-> 203
130 | IDE_init_failure
-> 205
131 | IDE_typechecker_died
-> 206
132 | IDE_new_client_connected
-> 207
133 | Lazy_decl_bug
-> 208
134 | Decl_heap_elems_bug
-> 209
135 | Parser_heap_build_error
-> 210
136 | File_provider_stale
-> 211
137 | Sql_assertion_failure
-> 212
138 | Local_type_env_stale
-> 213
139 | Sql_cantopen
-> 214
142 | Decl_not_found
-> 217
143 | Failed_to_load_should_retry
-> 218 (* gen by serverInit, read by serverMonitor+clientConnect *)
144 | Failed_to_load_should_abort
-> 219 (* gen by serverInit, read by serverMonitor+clientConnect *)
145 | Server_hung_up_should_abort
-> 220 (* generated by clientConnect, read by find_hh.sh *)
149 let ec = exit_code t
in
152 let to_string = function
154 | Build_error
-> "Build_error"
155 | Build_terminated
-> "Build_terminated"
156 | Checkpoint_error
-> "Checkpoint_error"
157 | Input_error
-> "Input_error"
158 | Kill_error
-> "Kill_error"
159 | No_server_running_should_retry
-> "No_server_running_should_retry"
160 | Server_hung_up_should_retry
-> "Server_hung_up_should_retry"
161 | Server_hung_up_should_abort
-> "Server_hung_up_should_abort"
162 | Out_of_time
-> "Out_of_time"
163 | Out_of_retries
-> "Out_of_retries"
164 | Server_already_exists
-> "Server_already_exists"
165 | Server_shutting_down
-> "Server_shutting_down"
166 | Type_error
-> "Type_error"
167 | Build_id_mismatch
-> "Build_id_mismatch"
168 | Monitor_connection_failure
-> "Monitor_connection_failure"
169 | Unused_server
-> "Unused_server"
170 | Lock_stolen
-> "Lock_stolen"
171 | Lost_parent_monitor
-> "Lost_parent_monitor"
172 | Interrupted
-> "Interrupted"
173 | Worker_oomed
-> "Worker_oomed"
174 | Worker_busy
-> "Worker_busy"
175 | Worker_not_found_exception
-> "Worker_not_found_exception"
176 | Worker_failed_to_send_job
-> "Worker_failed_to_send_job"
177 | Socket_error
-> "Socket_error"
178 | Missing_hhi
-> "Missing_hhi"
179 | Dfind_died
-> "Dfind_died"
180 | Dfind_unresponsive
-> "Dfind_unresponsive"
181 | EventLogger_Timeout
-> "EventLogger_Timeout"
182 | EventLogger_restart_out_of_retries
-> "EventLogger_restart_out_of_retries"
183 | EventLogger_broken_pipe
-> "EventLogger_broken_pipe"
184 | CantRunAI
-> "CantRunAI"
185 | Watchman_failed
-> "Watchman_failed"
186 | Watchman_fresh_instance
-> "Watchman_fresh_instance"
187 | Watchman_invalid_result
-> "Watchman_invalid_result"
188 | Hhconfig_deleted
-> "Hhconfig_deleted"
189 | Hhconfig_changed
-> "Hhconfig_changed"
190 | IDE_malformed_request
-> "IDE_malformed_request"
191 | IDE_no_server
-> "IDE_no_server"
192 | IDE_out_of_retries
-> "IDE_out_of_retries"
193 | Nfs_root
-> "Nfs_root"
194 | IDE_init_failure
-> "IDE_init_failure"
195 | IDE_typechecker_died
-> "IDE_typechecker_died"
196 | Redecl_heap_overflow
-> "Redecl_heap_overflow"
197 | Shared_mem_assertion_failure
-> "Shared_mem_assertion_failure"
198 | Out_of_shared_memory
-> "Out_of_shared_memory"
199 | Hash_table_full
-> "Hash_table_full"
200 | IDE_new_client_connected
-> "IDE_new_client_connected"
201 | Lazy_decl_bug
-> "Lazy_decl_bug"
202 | Decl_heap_elems_bug
-> "Decl_heap_elems_bug"
203 | Parser_heap_build_error
-> "Parser_heap_build_error"
204 | Heap_full
-> "Heap_full"
205 | File_provider_stale
-> "File_provider_stale"
206 | Sql_assertion_failure
-> "Sql_assertion_failure"
207 | Local_type_env_stale
-> "Local_type_env_stale"
208 | Sql_cantopen
-> "Sql_cantopen"
209 | Sql_corrupt
-> "Sql_corrupt"
210 | Sql_misuse
-> "Sql_misuse"
211 | Uncaught_exception
-> "Uncaught_exception"
212 | Decl_not_found
-> "Decl_not_found"
213 | Big_rebase_detected
-> "Big_rebase_detected"
214 | Failed_to_load_should_retry
-> "Failed_to_load_should_retry"
215 | Failed_to_load_should_abort
-> "Failed_to_load_should_abort"
219 let unpack = function
220 | Unix.WEXITED n
-> "exit", n
221 | Unix.WSIGNALED n
->
223 * Ocaml signal numbers are mapped from System signal numbers.
225 * See caml_convert_signal_number byterun/signals.c in Ocaml system source code
226 * to convert from Ocaml number to System number
229 | Unix.WSTOPPED n
-> "stopped", n