From: Michael Tremer Date: Thu, 26 Jun 2025 14:33:31 +0000 (+0000) Subject: job: Don't send crash reports any more X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d4cb50ddabb8c00a68a6129c9cbcc46a63af2f4b;p=pakfire.git job: Don't send crash reports any more This will be merged into the regular finished handler Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/client.c b/src/pakfire/client.c index 6a06bd7d..362e2b5a 100644 --- a/src/pakfire/client.c +++ b/src/pakfire/client.c @@ -1414,54 +1414,3 @@ ERROR: return r; } - -/* - This is called when a job has crashed. -*/ -int pakfire_client_job_crashed(struct pakfire_client* self, - const char* job_id, int signo, struct pakfire_buffer* log) { - struct json_object* request = NULL; - struct pakfire_xfer* xfer = NULL; - int r; - - // Create a new request object - r = pakfire_json_new_object(&request); - if (r < 0) - goto ERROR; - - // Add signal number - r = pakfire_json_add_int64(request, "signo", signo); - if (r < 0) - goto ERROR; - - // Optionally append the log - if (!pakfire_buffer_is_empty(log)) { - r = pakfire_json_add_bytes(request, "log", log->data, log->length); - if (r < 0) - goto ERROR; - } - - // Create a new transfer - r = pakfire_client_xfer_create(&xfer, self, "/api/v1/jobs/%s/crashed", job_id); - if (r < 0) - goto ERROR; - - // Enable authentication - r = pakfire_client_xfer_auth(self, xfer); - if (r < 0) - goto ERROR; - - // Set the request body - r = pakfire_xfer_set_json_payload(xfer, request); - if (r < 0) - goto ERROR; - - // Enqueue the transfer - r = pakfire_httpclient_enqueue(self->httpclient, xfer); - -ERROR: - if (xfer) - pakfire_xfer_unref(xfer); - - return r; -} diff --git a/src/pakfire/client.h b/src/pakfire/client.h index 2ebd4cdc..59b4bd19 100644 --- a/src/pakfire/client.h +++ b/src/pakfire/client.h @@ -110,9 +110,4 @@ int pakfire_client_create_repo(struct pakfire_client* client, int pakfire_client_delete_repo(struct pakfire_client* client, const char* distro, const char* name); -// Jobs - -int pakfire_client_job_crashed(struct pakfire_client* self, - const char* job_id, int signo, struct pakfire_buffer* log); - #endif /* PAKFIRE_CLIENT_H */ diff --git a/src/pakfire/job.c b/src/pakfire/job.c index d837ad35..201b0cbe 100644 --- a/src/pakfire/job.c +++ b/src/pakfire/job.c @@ -387,26 +387,6 @@ ERROR: return r; } -static int pakfire_job_crashed(struct pakfire_job* self, const siginfo_t* si) { - struct pakfire_buffer log = {}; - int r; - - DEBUG(self->ctx, "Sending crash report...\n"); - - // Dump the log - r = pakfire_log_buffer_dump(self->log.buffer, &log.data, &log.length); - if (r < 0) - goto ERROR; - - // Send the report - r = pakfire_client_job_crashed(self->client, self->id, si->si_status, &log); - -ERROR: - pakfire_buffer_free(&log); - - return r; -} - static int pakfire_job_result(struct pakfire_ctx* ctx, struct pakfire* pakfire, struct pakfire_build* build, struct pakfire_archive* archive, void* data) { struct pakfire_job* job = data; @@ -468,7 +448,6 @@ ERROR: */ static int pakfire_job_exited(sd_event_source* s, const siginfo_t* si, void* data) { struct pakfire_job* job = data; - int r; switch (si->si_code) { case CLD_EXITED: @@ -485,12 +464,6 @@ static int pakfire_job_exited(sd_event_source* s, const siginfo_t* si, void* dat // Update state job->state = PAKFIRE_JOB_STATE_KILLED; - - // Send some information about this - r = pakfire_job_crashed(job, si); - if (r < 0) - ERROR(job->ctx, "Could not send crash report: %s\n", strerror(-r)); - break; }