From 7cd83e15139447156ca915ce2d9d19295c146d56 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 15 May 2023 15:31:33 +0200 Subject: rework server-worker communication OK, this is a major rework. * tcp_server: connection threads are not detached anymore, the caller has to clean them up. This was done so that the server can clean up the threads cleanly. * run_queue: simple refactoring, run_queue_entry is called just run now. * server: worker threads are now killed when a run is assigned to a worker. * worker: the connection to server is no longer persistent. A worker sends "new-worker", waits for a task, closes the connection, and when it's done, sends the "complete" message and waits for a new task. This is supposed to improve resilience, since the worker-server connections don't have to be maintained while the worker is doing a CI run. --- src/const.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/const.h') diff --git a/src/const.h b/src/const.h index f53ef7e..2e7054b 100644 --- a/src/const.h +++ b/src/const.h @@ -16,5 +16,6 @@ #define CMD_RUN "run" #define CMD_NEW_WORKER "new-worker" +#define CMD_COMPLETE "complete" #endif -- cgit v1.2.3