Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 861410 Details for
Bug 1063317
abrt-addon-upload-watch: /usr/sbin/abrt-upload-watch uses 100% CPU
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch fixing this bug
upload-watch-remove-busy-wait-for-SIGUSR1.patch (text/plain), 3.61 KB, created by
Jakub Filak
on 2014-02-10 14:30:35 UTC
(
hide
)
Description:
Patch fixing this bug
Filename:
MIME Type:
Creator:
Jakub Filak
Created:
2014-02-10 14:30:35 UTC
Size:
3.61 KB
patch
obsolete
>From b23cb1c47c7acb28a002162cd2dcf897e9f0f019 Mon Sep 17 00:00:00 2001 >From: Jakub Filak <jfilak@redhat.com> >Date: Fri, 7 Feb 2014 17:54:14 +0100 >Subject: [ABRT PATCH] upload-watch: remove busy-wait for SIGUSR1 > >Unconditional checking of SIGUSR1 flag in the idle source of main loop >causes 100% CPU usage. > >hanle_sigusr() function and got_sigusr flag are not necessary because >abrt-upload-watch already implements signal handling based on usage of >GIO Channels. > >Closes rhbz#1063317 > >Signed-off-by: Jakub Filak <jfilak@redhat.com> >--- > src/daemon/abrt-upload-watch.c | 37 +++++++++---------------------------- > 1 file changed, 9 insertions(+), 28 deletions(-) > >diff --git a/src/daemon/abrt-upload-watch.c b/src/daemon/abrt-upload-watch.c >index 59bfbe4..a42b285 100644 >--- a/src/daemon/abrt-upload-watch.c >+++ b/src/daemon/abrt-upload-watch.c >@@ -27,7 +27,6 @@ > #define DEFAULT_CACHE_MIB_SIZE 4 > > static int g_signal_pipe[2]; >-static sig_atomic_t got_sigusr; > > struct queue > { >@@ -122,24 +121,11 @@ handle_new_path(struct process *proc, char *name) > } > } > >-static gboolean >+static void > print_stats(struct process *proc) > { >- /* there is a race, because we run this function from 2 different places >- * 1st when a child dies >- * 2nd as idle source from mainloop >- * if it happens the stats will be printed twice, which I think >- * is not a big deal, because it's only for debug and tests >- */ >- if (got_sigusr == 1) >- { >- got_sigusr = 0; >- /* this is meant only for debugging, so not marking it as translatable */ >- fprintf(stderr, "%i archives to process, %i active workers\n", g_queue_get_length(&proc->queue.q), proc->children); >- } >- >- /* don't remove this source from glib */ >- return true; >+ /* this is meant only for debugging, so not marking it as translatable */ >+ fprintf(stderr, "%i archives to process, %i active workers\n", g_queue_get_length(&proc->queue.q), proc->children); > } > > static void >@@ -157,13 +143,6 @@ process_next_in_queue(struct process *proc) > } > > static void >-handle_sigusr(int signo) >-{ >- /* just set the flag and process it synchronously */ >- got_sigusr = 1; >-} >- >-static void > handle_signal(int signo) > { > int save_errno = errno; >@@ -200,7 +179,11 @@ handle_signal_pipe_cb(GIOChannel *gio, GIOCondition condition, gpointer user_dat > { > /* we did receive a signal */ > log_debug("Got signal %d through signal pipe", signals[signo]); >- if (signals[signo] != SIGCHLD) >+ if (signals[signo] == SIGUSR1) >+ { >+ print_stats(proc); >+ } >+ else if (signals[signo] != SIGCHLD) > { > process_quit(proc); > return FALSE; /* remove this event */ >@@ -363,7 +346,7 @@ main(int argc, char **argv) > close_on_exec_on(g_signal_pipe[1]); > ndelay_on(g_signal_pipe[0]); > ndelay_on(g_signal_pipe[1]); >- signal(SIGUSR1, handle_sigusr); >+ signal(SIGUSR1, handle_signal); > signal(SIGTERM, handle_signal); > signal(SIGINT, handle_signal); > signal(SIGCHLD, handle_signal); >@@ -373,7 +356,6 @@ main(int argc, char **argv) > handle_signal_pipe_cb, > &proc); > >- int status_callback_source_id = g_idle_add((GSourceFunc)print_stats, &proc); > log_info("Starting glib main loop"); > > g_main_loop_run(proc.main_loop); >@@ -381,7 +363,6 @@ main(int argc, char **argv) > log_info("Glib main loop finished"); > > g_source_remove(channel_signal_source_id); >- g_source_remove(status_callback_source_id); > > GError *error = NULL; > g_io_channel_shutdown(channel_signal, FALSE, &error); >-- >1.8.3.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1063317
: 861410