Il 21/02/2012 22:03, Riccardo Magliocchetti ha scritto:
Il 21/02/2012 21:56, Riccardo Magliocchetti ha scritto:
The stackstrace suggests it's a bug in carbon plugin, you may want to
rebuild uwsgi with debug set to true in the config file and post a `bt
full` to help Roberto debug the issue.
Oh well it looks like a genuine divide by zero, avg_rt_workers may be
zero if cheap mode is on:
120:rlen = snprintf(ptr, 4096, "uwsgi.%s.%s.avg_rt %llu %llu\n",
uwsgi.hostname, u_carbon.id,
(unsigned long long ) total_avg_rt / avg_rt_workers, (unsigned long long
) uwsgi.current_time);
Does the attached patch help?
riccardo
One that may actually work, not even compile tested anyway :)
riccardo
diff -r b82c43710ad7 plugins/carbon/carbon.c
--- a/plugins/carbon/carbon.c Mon Feb 20 04:07:16 2012 +0100
+++ b/plugins/carbon/carbon.c Tue Feb 21 22:04:31 2012 +0100
@@ -117,7 +117,7 @@
if (rlen < 1) goto clear;
if (write(fd, ptr, rlen) <= 0) { uwsgi_error("write()"); goto clear;}
- rlen = snprintf(ptr, 4096, "uwsgi.%s.%s.avg_rt %llu %llu\n", uwsgi.hostname, u_carbon.id, (unsigned long long ) total_avg_rt / avg_rt_workers, (unsigned long long ) uwsgi.current_time);
+ rlen = snprintf(ptr, 4096, "uwsgi.%s.%s.avg_rt %llu %llu\n", uwsgi.hostname, u_carbon.id, avg_rt_workers ? (unsigned long long) total_avg_rt / avg_rt_workers : 0, (unsigned long long ) uwsgi.current_time);
if (rlen < 1) goto clear;
if (write(fd, ptr, rlen) <= 0) { uwsgi_error("write()"); goto clear;}
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi