File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,13 @@ class AsyncTask
6666 */
6767 private const TIME_EPSILON = 0.1 ;
6868
69+ /**
70+ * The bitmask that can filter for fatal runtime errors.
71+ *
72+ * Fatal errors other than the specific "time limit exceeded" error must not trigger the timeout handlers.
73+ */
74+ private const FATAL_ERROR_BITMASK = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR ;
75+
6976 /**
7077 * Indicates whether GNU coreutils is found in the system; in particular, we are looking for the timeout command inside coreutils.
7178 *
@@ -314,7 +321,7 @@ private function hasTimedOut(): bool
314321 // runtime timeout triggers a PHP fatal error
315322 // this can happen on Windows by our specification, or on Unix when the actual CLI PHP time limit is smaller than the time limit of this task
316323 $ lastError = error_get_last ();
317- if ($ lastError !== null ) {
324+ if ($ lastError !== null && ( $ lastError [ ' type ' ] & self :: FATAL_ERROR_BITMASK ) ) {
318325 // has fatal error; is it our timeout error?
319326 fwrite (STDERR , "error_get_last " . json_encode ($ lastError ) . PHP_EOL );
320327 return str_contains ($ lastError ['message ' ], "Maximum execution time " );
You can’t perform that action at this time.
0 commit comments