mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
* handle failures gracefully * fix super-subtle race condition * address feedback: panic instead of fatal log and make vars into consts * pass the frankenphp context to worker-ready function * reset backoff and failures on normal restart * update docs * add test and fix race condition * fail sometimes but do not be pathological about it * Use title case Co-authored-by: Kévin Dunglas <kevin@dunglas.fr> * fix code style in php * define lifecycle metrics * ensure we update unregister the metrics and fix tests * update caddy tests and fix typo * update docs * no need for this --------- Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
19 lines
256 B
PHP
19 lines
256 B
PHP
<?php
|
|
|
|
$fail = random_int(1, 100) < 1;
|
|
$wait = random_int(1, 5);
|
|
|
|
sleep($wait);
|
|
if ($fail) {
|
|
exit(1);
|
|
}
|
|
|
|
while (frankenphp_handle_request(function () {
|
|
echo "ok";
|
|
})) {
|
|
$fail = random_int(1, 100) < 10;
|
|
if ($fail) {
|
|
exit(1);
|
|
}
|
|
}
|