Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 58024 invoked from network); 7 Apr 2009 13:38:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Apr 2009 13:38:26 -0000 Received: (qmail 57246 invoked by uid 500); 7 Apr 2009 13:38:25 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 57165 invoked by uid 500); 7 Apr 2009 13:38:25 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 57156 invoked by uid 99); 7 Apr 2009 13:38:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Apr 2009 13:38:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Apr 2009 13:38:23 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3CF6123888E7; Tue, 7 Apr 2009 13:38:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r762771 - /httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Date: Tue, 07 Apr 2009 13:38:02 -0000 To: cvs@httpd.apache.org From: jfclere@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090407133802.3CF6123888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jfclere Date: Tue Apr 7 13:38:01 2009 New Revision: 762771 URL: http://svn.apache.org/viewvc?rev=762771&view=rev Log: Arrange traces. Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=762771&r1=762770&r2=762771&view=diff ============================================================================== --- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original) +++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Tue Apr 7 13:38:01 2009 @@ -66,14 +66,14 @@ SOCK_DGRAM, APR_PROTO_UDP, ctx->p); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to create listening socket."); return rv; } rv = apr_socket_opt_set(ctx->sock, APR_SO_REUSEADDR, 1); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to set APR_SO_REUSEADDR to 1 on socket."); return rv; } @@ -81,14 +81,14 @@ rv = apr_socket_opt_set(ctx->sock, APR_SO_NONBLOCK, 1); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to set APR_SO_REUSEADDR to 1 on socket."); return rv; } rv = apr_socket_bind(ctx->sock, ctx->mcast_addr); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to bind on socket."); return rv; } @@ -96,14 +96,14 @@ rv = apr_mcast_join(ctx->sock, ctx->mcast_addr, NULL, NULL); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to join multicast group"); return rv; } rv = apr_mcast_loopback(ctx->sock, 1); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Failed to accept localhost mulitcast on socket."); return rv; } @@ -162,7 +162,7 @@ rv = apr_file_mktemp(&fp, path, APR_CREATE | APR_WRITE, p); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to open tmp file: %s", path); return rv; } @@ -188,14 +188,14 @@ rv = apr_file_flush(fp); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to flush file: %s", path); return rv; } rv = apr_file_close(fp); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to close file: %s", path); return rv; } @@ -204,7 +204,7 @@ APR_FPROT_UREAD | APR_FPROT_GREAD | APR_FPROT_WREAD); if (rv && rv != APR_INCOMPLETE) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to set file permssions on %s", path); return rv; @@ -213,7 +213,7 @@ rv = apr_file_rename(path, ctx->storage_path, p); if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to move file: %s -> %s", path, ctx->storage_path); return rv; @@ -254,12 +254,12 @@ rv = apr_socket_recvfrom(&from, ctx->sock, 0, buf, &len); if (APR_STATUS_IS_EAGAIN(rv)) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: would block"); return APR_SUCCESS; } else if (rv) { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: recvfrom failed"); return rv; } @@ -276,7 +276,7 @@ char *ip; hm_server_t *s; /* TODO: REMOVE ME BEFORE PRODUCTION (????) */ - ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_DEBUG, rv, ctx->s, "Heartmonitor: %pI busy=%s ready=%s", &from, apr_table_get(tbl, "busy"), apr_table_get(tbl, "ready")); @@ -289,7 +289,7 @@ s->seen = apr_time_now(); } else { - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: malformed multicast message from %pI", &from); } @@ -313,7 +313,7 @@ rv = hm_listen(ctx); if (rv) { ctx->status = rv; - ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ctx->s, "Heartmonitor: Unable to listen for connections!"); } else { @@ -343,6 +343,7 @@ pfd.p = p; pfd.reqevents = APR_POLLIN; + // timeout = apr_time_from_sec((apr_time_sec(ctx->interval) - now + cur)>1 ? (apr_time_sec(ctx->interval) - now + cur) : 1); timeout = apr_time_from_sec(1); rc = apr_poll(&pfd, 1, &n, timeout); @@ -404,7 +405,7 @@ "callback (%s)", HM_WATHCHDOG_NAME); return !OK; } - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL, + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Heartmonitor: wd callback %s", HM_WATHCHDOG_NAME); return OK;