mirror of
https://github.com/dunglas/frankenphp
synced 2024-10-16 17:14:59 +00:00
fix: random crashes when reloading (#394)
This commit is contained in:
parent
ebd5b45dda
commit
517e086786
11
.github/workflows/tests.yaml
vendored
11
.github/workflows/tests.yaml
vendored
@ -53,6 +53,17 @@ jobs:
|
||||
name: Run Caddy module tests
|
||||
working-directory: caddy/
|
||||
run: go test -race -v ./...
|
||||
-
|
||||
name: Build the server
|
||||
working-directory: caddy/frankenphp/
|
||||
run: go build
|
||||
-
|
||||
name: Start the server
|
||||
working-directory: testdata/
|
||||
run: sudo ../caddy/frankenphp/frankenphp start
|
||||
-
|
||||
name: Run integrations tests
|
||||
run: ./reload_test.sh
|
||||
-
|
||||
name: Lint Go code
|
||||
uses: golangci/golangci-lint-action@v3
|
||||
|
@ -528,6 +528,8 @@ static void bsem_init(bsem *bsem_p, int value) {
|
||||
|
||||
/* Reset semaphore to 0 */
|
||||
static void bsem_reset(bsem *bsem_p) {
|
||||
pthread_mutex_destroy(&(bsem_p->mutex));
|
||||
pthread_cond_destroy(&(bsem_p->cond));
|
||||
bsem_init(bsem_p, 0);
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "C-Thread-Pool/thpool.c"
|
||||
#include "C-Thread-Pool/thpool.h"
|
||||
|
4
reload_test.sh
Executable file
4
reload_test.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
for ((i = 0 ; i < 100 ; i++)); do
|
||||
curl --no-progress-meter -o /dev/null http://localhost:2019/config/apps/frankenphp -: --no-progress-meter -o /dev/null -H 'Cache-Control: must-revalidate' -H 'Content-Type: application/json' --data-binary '{"workers":[{"file_name":"./index.php"}]}' -X PATCH http://localhost:2019/config/apps/frankenphp
|
||||
done
|
Loading…
Reference in New Issue
Block a user