diff options
| author | Alan Conway <aconway@apache.org> | 2011-03-28 23:18:16 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-03-28 23:18:16 +0000 |
| commit | 73b7ec00e546b27d2bed22d30ad48a8735cfe6f0 (patch) | |
| tree | 45900f0e0a964b814207fd0adfbacc36b0bbab26 /qpid/cpp | |
| parent | ea98033c3df7fbc1364df69c4edb5cf1e808e87e (diff) | |
| download | qpid-python-73b7ec00e546b27d2bed22d30ad48a8735cfe6f0.tar.gz | |
Merge branch 'trunk' into qpid-2920
Conflicts:
qpid/cpp/src/cluster.mk
qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-2920@1086439 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp')
26 files changed, 403 insertions, 62 deletions
diff --git a/qpid/cpp/bindings/qmf/tests/test_base.rb b/qpid/cpp/bindings/qmf/tests/test_base.rb index 3e4337a9c0..7d4609097c 100644 --- a/qpid/cpp/bindings/qmf/tests/test_base.rb +++ b/qpid/cpp/bindings/qmf/tests/test_base.rb @@ -24,6 +24,7 @@ require 'socket' class ConsoleTestBase < Qmf::ConsoleHandler def initialize + sleep(2) @settings = Qmf::ConnectionSettings.new @settings.host = ARGV[0] if ARGV.size > 0 @settings.port = ARGV[1].to_i if ARGV.size > 1 @@ -67,7 +68,7 @@ class ConsoleTestBase < Qmf::ConsoleHandler def assert(condition, in_text=nil) text = " (#{in_text})" if in_text - raise "Assertion failed: #{left} != #{right}#{text}" unless condition + raise "Assertion failed: #{condition} #{text}" unless condition end def fail(text) diff --git a/qpid/cpp/docs/man/Makefile.am b/qpid/cpp/docs/man/Makefile.am index 14295f73bf..b821568f81 100644 --- a/qpid/cpp/docs/man/Makefile.am +++ b/qpid/cpp/docs/man/Makefile.am @@ -16,10 +16,29 @@ # specific language governing permissions and limitations # under the License. # + +# Generate makefile from qpidd --help +# +# Note: qiddd.1 is normally a _checked in_ pre-generated file, so that +# make dist does not have to build the entire source just for the man page. +# +# To update the checked-in file (e.g. for a new release) do the following: +# +# - start with a completely clean checkout. +# - make sure there are no modules installed in your configured prefix, +# we don't want to pick up configuration from optional modules +# - do bootstrap; configure +# - in build-dir: cd src; make # build the broker +# - in source-dir: cd docs/man; rm qpidd.1 # remove checked-in man page. +# - in build-dir: cd docs/man; make # make new man page +# - edit qpidd.1 to remove all default values referring to file/directory locations. +# these values will differ between builds depending on configuration. +# - if source-dir != build-dir: copy qpidd.1 from build-dir/docs/man to source-dir/docs/man + dist_man_MANS = qpidd.1 -man_aux = $(dist_man_MANS:.1=.x) -EXTRA_DIST = $(man_aux) generate_manpage groffify_options.sed groffify_template.sed +man_aux = $(dist_man_MANS:.1=.x) +EXTRA_DIST = $(man_aux) generate_manpage groffify_options.sed groffify_template.sed DISTCLEANFILES = $(dist_man_MANS) CLEANFILES=qpidd.1 diff --git a/qpid/cpp/docs/man/qpidd.1 b/qpid/cpp/docs/man/qpidd.1 new file mode 100644 index 0000000000..d2cff454cf --- /dev/null +++ b/qpid/cpp/docs/man/qpidd.1 @@ -0,0 +1,247 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.38.2. +.TH QPIDD "1" "March 2011" "qpidd (qpidc) version 0.11" "User Commands" +.SH NAME + +qpidd \- the Qpid AMQP Message Broker Daemon +.SH SYNOPSIS + +qpidd [-p port] [--config config_file] [--data-dir directory] +.SH DESCRIPTION + +An AMQP message broker daemon that stores, routes and forwards +messages using the Advanced Message Queueing Protocol (AMQP). +.SH OPTIONS + +The options below are built-in to qpidd. Installing add-on modules provides additional options. To see the full set of options available type "qpidd --help" + +Options may be specified via command line, environment variable or configuration file. See FILES and ENVIRONMENT below for details. +.PP + +.TP +\fB\-h\fR [ \fB\-\-help\fR ] +Displays the help message +.TP +\fB\-v\fR [ \fB\-\-version\fR ] +Displays version information +.TP +\fB\-\-config\fR FILE +Reads configuration from FILE +.SS "Module options:" +.TP +\fB\-\-module\-dir\fR DIR +Load all shareable modules in this +directory +.TP +\fB\-\-load\-module\fR FILE +Specifies additional module(s) to be +loaded +.TP +\fB\-\-no\-module\-dir\fR +Don't load modules from module +directory +.SS "Broker Options:" +.TP +\fB\-\-data\-dir\fR DIR +Directory to contain persistent data +generated by the broker +.TP +\fB\-\-no\-data\-dir\fR +Don't use a data directory. No +persistent configuration will be loaded +or stored +.TP +\fB\-p\fR [ \fB\-\-port\fR ] PORT (5672) +Tells the broker to listen on PORT +.TP +\fB\-\-worker\-threads\fR N (3) +Sets the broker thread pool size +.TP +\fB\-\-max\-connections\fR N (500) +Sets the maximum allowed connections +.TP +\fB\-\-connection\-backlog\fR N (10) +Sets the connection backlog limit for +the server socket +.TP +\fB\-m\fR [ \fB\-\-mgmt\-enable\fR ] yes|no (1) +Enable Management +.TP +\fB\-\-mgmt\-qmf2\fR yes|no (1) +Enable broadcast of management +information over QMF v2 +.TP +\fB\-\-mgmt\-qmf1\fR yes|no (1) +Enable broadcast of management +information over QMF v1 +.TP +\fB\-\-mgmt\-pub\-interval\fR SECONDS (10) +Management Publish Interval +.TP +\fB\-\-queue\-purge\-interval\fR SECONDS (600) +Interval between attempts to purge any +expired messages from queues +.TP +\fB\-\-auth\fR yes|no (1) +Enable authentication, if disabled all +incoming connections will be trusted +.TP +\fB\-\-realm\fR REALM (QPID) +Use the given realm when performing +authentication +.TP +\fB\-\-default\-queue\-limit\fR BYTES (104857600) +Default maximum size for queues (in +bytes) +.TP +\fB\-\-tcp\-nodelay\fR +Set TCP_NODELAY on TCP connections +.TP +\fB\-\-require\-encryption\fR +Only accept connections that are +encrypted +.TP +\fB\-\-known\-hosts\-url\fR URL or 'none' +URL to send as 'known\-hosts' to clients +('none' implies empty list) +.TP +\fB\-\-sasl\-config\fR DIR +gets sasl config info from nonstandard +location +.TP +\fB\-\-max\-session\-rate\fR MESSAGES/S (0) +Sets the maximum message rate per +session (0=unlimited) +.TP +\fB\-\-async\-queue\-events\fR yes|no (0) +Set Queue Events async, used for +services like replication +.TP +\fB\-\-default\-flow\-stop\-threshold\fR PERCENT (80) +Percent of queue's maximum capacity at +which flow control is activated. +.TP +\fB\-\-default\-flow\-resume\-threshold\fR PERCENT (70) +Percent of queue's maximum capacity at +which flow control is de\-activated. +.TP +\fB\-\-default\-event\-threshold\-ratio\fR %age of limit (80) +The ratio of any specified queue limit +at which an event will be raised +.SS "Logging options:" +.TP +\fB\-t\fR [ \fB\-\-trace\fR ] +Enables all logging +.TP +\fB\-\-log\-enable\fR RULE (notice+) +Enables logging for selected levels and +components. RULE is in the form +\&'LEVEL[+][:PATTERN]' Levels are one of: +.IP +trace debug info notice warning error +.IP +critical +For example: +\&'\-\-log\-enable warning+' logs all +warning, error and critical messages. +\&'\-\-log\-enable debug:framing' logs debug +messages from the framing namespace. +This option can be used multiple times +.TP +\fB\-\-log\-time\fR yes|no (1) +Include time in log messages +.TP +\fB\-\-log\-level\fR yes|no (1) +Include severity level in log messages +.TP +\fB\-\-log\-source\fR yes|no (0) +Include source file:line in log +messages +.TP +\fB\-\-log\-thread\fR yes|no (0) +Include thread ID in log messages +.TP +\fB\-\-log\-function\fR yes|no (0) +Include function signature in log +messages +.TP +\fB\-\-log\-prefix\fR STRING +Prefix to append to all log messages +.SS "Logging sink options:" +.TP +\fB\-\-log\-to\-stderr\fR yes|no (1) +Send logging output to stderr +.TP +\fB\-\-log\-to\-stdout\fR yes|no (0) +Send logging output to stdout +.TP +\fB\-\-log\-to\-file\fR FILE +Send log output to FILE. +.TP +\fB\-\-log\-to\-syslog\fR yes|no (0) +Send logging output to syslog; +customize using \fB\-\-syslog\-name\fR and +\fB\-\-syslog\-facility\fR +.TP +\fB\-\-syslog\-name\fR NAME (lt\-qpidd) +Name to use in syslog messages +.TP +\fB\-\-syslog\-facility\fR LOG_XXX (LOG_DAEMON) +Facility to use in syslog messages +.SS "Daemon options:" +.TP +\fB\-d\fR [ \fB\-\-daemon\fR ] +Run as a daemon. Logs to syslog by +default in this mode. +.TP +\fB\-\-transport\fR TRANSPORT (tcp) +The transport for which to return the +port +.TP +\fB\-\-pid\-dir\fR DIR +Directory where port\-specific PID file +is stored +.TP +\fB\-w\fR [ \fB\-\-wait\fR ] SECONDS (600) +Sets the maximum wait time to +initialize the daemon. If the daemon +fails to initialize, prints an error +and returns 1 +.TP +\fB\-c\fR [ \fB\-\-check\fR ] +Prints the daemon's process ID to +stdout and returns 0 if the daemon is +running, otherwise returns 1 +.TP +\fB\-q\fR [ \fB\-\-quit\fR ] +Tells the daemon to shut down +.SH ENVIRONMENT +.I QPID_<option> +.RS +There is an environment variable for each option. +.RE + +The environment variable is the option name in uppercase, prefixed with QPID_ and '.' or '-' are replaced with '_'. Environment settings are over-ridden by command line settings. For example: + + export QPID_PORT=6000 + export QPID_MAX_CONNECTIONS=10 + export QPID_LOG_TO_FILE=/tmp/qpidd.log +.SH FILES +.I /etc/qpidd.conf +.RS +Default configuration file. +.RE + +Configuration file settings are over-ridden by command line or environment variable settings. '--config <file>' or 'export QPID_CONFIG=<file>' specifies an alternate file. + +Each line is a name=value pair. Blank lines and lines beginning with # are ignored. For example: + + # My qpidd configuration file. + port=6000 + max-connections=10 + log-to-file=/tmp/qpidd.log +.SH AUTHOR + +The Apache Qpid Project, dev@qpid.apache.org +.SH "REPORTING BUGS" + +Please report bugs to users@qpid.apache.org diff --git a/qpid/cpp/docs/man/qpidd.x b/qpid/cpp/docs/man/qpidd.x index af5d9628ee..0ccf3b562a 100644 --- a/qpid/cpp/docs/man/qpidd.x +++ b/qpid/cpp/docs/man/qpidd.x @@ -13,6 +13,8 @@ messages using the Advanced Message Queueing Protocol (AMQP). [OPTIONS] +The options below are built-in to qpidd. Installing add-on modules provides additional options. To see the full set of options available type "qpidd --help" + Options may be specified via command line, environment variable or configuration file. See FILES and ENVIRONMENT below for details. [FILES] diff --git a/qpid/cpp/managementgen/qmfgen/schema.py b/qpid/cpp/managementgen/qmfgen/schema.py index afdfe42639..59e951fb6e 100755 --- a/qpid/cpp/managementgen/qmfgen/schema.py +++ b/qpid/cpp/managementgen/qmfgen/schema.py @@ -1731,9 +1731,9 @@ class SchemaPackage: stream.write(" qmf::SchemaProperty arg(\"%s\", %s);\n" % (arg.name, typeName)) if subType: stream.write(" arg.setSubtype(\"%s\");\n" % subType) - if stat.unit: + if arg.unit: stream.write(" arg.setUnit(\"%s\");\n" % arg.unit) - if stat.desc: + if arg.desc: stream.write(" arg.setDesc(\"%s\");\n" % arg.desc) stream.write(" arg.setDirection(%s);\n" % self.qmfv2Dir(arg.dir)) stream.write(" method.addArgument(arg);\n") diff --git a/qpid/cpp/rubygen/amqpgen.rb b/qpid/cpp/rubygen/amqpgen.rb index 69e65a4056..20aac35194 100755 --- a/qpid/cpp/rubygen/amqpgen.rb +++ b/qpid/cpp/rubygen/amqpgen.rb @@ -61,7 +61,8 @@ end class Module # Add trailing _ to avoid conflict with Object methods. def mangle(sym) - (Object.method_defined? sym) ? (sym.to_s+"_").intern : sym + sym = (sym.to_s+"_").to_sym if (Object.method_defined?(sym) or sym == :type) + sym end # Add attribute reader for XML attribute. diff --git a/qpid/cpp/src/Makefile.am b/qpid/cpp/src/Makefile.am index d7be7121c1..820d97439c 100644 --- a/qpid/cpp/src/Makefile.am +++ b/qpid/cpp/src/Makefile.am @@ -127,14 +127,14 @@ qpidexec_SCRIPTS = qpidtestdir = $(qpidexecdir)/tests qpidtest_PROGRAMS = qpidtest_SCRIPTS = -tmoduledir = $(libdir)/qpid/tests -tmodule_LTLIBRARIES= +tmoduleexecdir = $(libdir)/qpid/tests +tmoduleexec_LTLIBRARIES= AM_CXXFLAGS += -DBOOST_FILESYSTEM_VERSION=2 ## Automake macros to build libraries and executables. -qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduledir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" -libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduledir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" +qpidd_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDD_MODULE_DIR=\"$(dmoduleexecdir)\" -DQPIDD_CONF_FILE=\"$(sysconfdir)/qpidd.conf\" +libqpidclient_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_MODULE_DIR=\"$(cmoduleexecdir)\" -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.conf\" qpidd_LDADD = \ libqpidbroker.la \ @@ -200,10 +200,10 @@ lib_LTLIBRARIES = libqpidtypes.la libqpidcommon.la libqpidbroker.la libqpidclien # Definitions for client and daemon plugins PLUGINLDFLAGS=-no-undefined -module -avoid-version confdir=$(sysconfdir)/qpid -dmoduledir=$(libdir)/qpid/daemon -cmoduledir=$(libdir)/qpid/client -dmodule_LTLIBRARIES = -cmodule_LTLIBRARIES = +dmoduleexecdir=$(libdir)/qpid/daemon +cmoduleexecdir=$(libdir)/qpid/client +dmoduleexec_LTLIBRARIES = +cmoduleexec_LTLIBRARIES = include cluster.mk include acl.mk @@ -245,7 +245,7 @@ rdma_la_LIBADD = \ rdma_la_LDFLAGS = $(PLUGINLDFLAGS) rdma_la_CXXFLAGS = \ $(AM_CXXFLAGS) -Wno-missing-field-initializers -dmodule_LTLIBRARIES += \ +dmoduleexec_LTLIBRARIES += \ rdma.la rdmaconnector_la_SOURCES = \ @@ -257,7 +257,7 @@ rdmaconnector_la_LIBADD = \ rdmaconnector_la_LDFLAGS = $(PLUGINLDFLAGS) rdmaconnector_la_CXXFLAGS = \ $(AM_CXXFLAGS) -Wno-missing-field-initializers -cmodule_LTLIBRARIES += \ +cmoduleexec_LTLIBRARIES += \ rdmaconnector.la # RDMA test/sample programs @@ -332,6 +332,7 @@ libqpidcommon_la_SOURCES += \ qpid/Address.cpp \ qpid/DataDir.cpp \ qpid/DataDir.h \ + qpid/DisableExceptionLogging.h \ qpid/Exception.cpp \ qpid/Modules.cpp \ qpid/Modules.h \ @@ -887,10 +888,6 @@ nobase_include_HEADERS += \ ../include/qpid/types/Variant.h \ ../include/qpid/types/ImportExport.h -# Force build of qpidd during dist phase so help2man will work. -dist-hook: $(BUILT_SOURCES) - $(MAKE) qpidd - # Create the default data directory install-data-local: $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/lib/qpidd diff --git a/qpid/cpp/src/acl.mk b/qpid/cpp/src/acl.mk index bcd1d88335..b8e2ff0e13 100644 --- a/qpid/cpp/src/acl.mk +++ b/qpid/cpp/src/acl.mk @@ -18,8 +18,8 @@ # # # acl library makefile fragment, to be included in Makefile.am -# -dmodule_LTLIBRARIES += acl.la +# +dmoduleexec_LTLIBRARIES += acl.la acl_la_SOURCES = \ qpid/acl/Acl.cpp \ diff --git a/qpid/cpp/src/cluster.mk b/qpid/cpp/src/cluster.mk index 86448d991c..cbb48798c1 100644 --- a/qpid/cpp/src/cluster.mk +++ b/qpid/cpp/src/cluster.mk @@ -34,7 +34,8 @@ endif if HAVE_LIBCPG -dmodule_LTLIBRARIES += cluster.la +dmoduleexec_LTLIBRARIES += cluster.la + cluster_la_SOURCES = \ $(CMAN_SOURCES) \ qpid/cluster/Cluster.cpp \ @@ -128,7 +129,7 @@ cluster2_la_SOURCES = \ # The watchdog plugin and helper executable -dmodule_LTLIBRARIES += watchdog.la +dmoduleexec_LTLIBRARIES += watchdog.la watchdog_la_SOURCES = qpid/cluster/WatchDogPlugin.cpp watchdog_la_LIBADD = libqpidbroker.la watchdog_la_LDFLAGS = $(PLUGINLDFLAGS) diff --git a/qpid/cpp/src/qpid/DisableExceptionLogging.h b/qpid/cpp/src/qpid/DisableExceptionLogging.h new file mode 100644 index 0000000000..04a9240513 --- /dev/null +++ b/qpid/cpp/src/qpid/DisableExceptionLogging.h @@ -0,0 +1,39 @@ +#ifndef QPID_DISABLEEXCEPTIONLOGGING_H +#define QPID_DISABLEEXCEPTIONLOGGING_H + +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +#include "qpid/CommonImportExport.h" + +namespace qpid { + +/** + * Temporarily disable logging in qpid::Exception constructor. + * Used by log::Logger to avoid logging exceptions during Logger construction. + */ +struct DisableExceptionLogging +{ + QPID_COMMON_EXTERN DisableExceptionLogging(); + QPID_COMMON_EXTERN ~DisableExceptionLogging(); +}; +} // namespace qpid + +#endif /*!QPID_DISABLEEXCEPTIONLOGGING_H*/ diff --git a/qpid/cpp/src/qpid/Exception.cpp b/qpid/cpp/src/qpid/Exception.cpp index 16a3a13d17..a6696f06e1 100644 --- a/qpid/cpp/src/qpid/Exception.cpp +++ b/qpid/cpp/src/qpid/Exception.cpp @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -21,13 +21,25 @@ #include "qpid/log/Statement.h" #include "qpid/Exception.h" +#include "qpid/DisableExceptionLogging.h" #include <typeinfo> #include <assert.h> #include <string.h> namespace qpid { +// Note on static initialization order: if an exception is constructed +// in a static constructor before disableExceptionLogging has been +// initialized, the worst that can happen is we lose an exception log +// message. Since we shouldn't be throwing a lot of exceptions during +// static construction this seems safe. +static bool disableExceptionLogging = false; + +DisableExceptionLogging::DisableExceptionLogging() { disableExceptionLogging = true; } +DisableExceptionLogging::~DisableExceptionLogging() { disableExceptionLogging = false; } + Exception::Exception(const std::string& msg) throw() : message(msg) { + if (disableExceptionLogging) return; QPID_LOG_IF(debug, !msg.empty(), "Exception constructed: " << message); } diff --git a/qpid/cpp/src/qpid/acl/Acl.cpp b/qpid/cpp/src/qpid/acl/Acl.cpp index 67603015d7..4b3dda7962 100644 --- a/qpid/cpp/src/qpid/acl/Acl.cpp +++ b/qpid/cpp/src/qpid/acl/Acl.cpp @@ -180,7 +180,10 @@ Acl::Acl (AclValues& av, Broker& b): aclValues(av), broker(&b), transferAcl(fals { case _qmf::Acl::METHOD_RELOADACLFILE : readAclFile(text); - status = Manageable::STATUS_USER; + if (text.empty()) + status = Manageable::STATUS_OK; + else + status = Manageable::STATUS_USER; break; } diff --git a/qpid/cpp/src/qpid/broker/Broker.cpp b/qpid/cpp/src/qpid/broker/Broker.cpp index 1b64fb2a52..3edcb2c0eb 100644 --- a/qpid/cpp/src/qpid/broker/Broker.cpp +++ b/qpid/cpp/src/qpid/broker/Broker.cpp @@ -157,8 +157,8 @@ Broker::Options::Options(const std::string& name) : ("sasl-config", optValue(saslConfigPath, "DIR"), "gets sasl config info from nonstandard location") ("max-session-rate", optValue(maxSessionRate, "MESSAGES/S"), "Sets the maximum message rate per session (0=unlimited)") ("async-queue-events", optValue(asyncQueueEvents, "yes|no"), "Set Queue Events async, used for services like replication") - ("default-flow-stop-threshold", optValue(queueFlowStopRatio, "%MESSAGES"), "Queue capacity level at which flow control is activated.") - ("default-flow-resume-threshold", optValue(queueFlowResumeRatio, "%MESSAGES"), "Queue capacity level at which flow control is de-activated.") + ("default-flow-stop-threshold", optValue(queueFlowStopRatio, "PERCENT"), "Percent of queue's maximum capacity at which flow control is activated.") + ("default-flow-resume-threshold", optValue(queueFlowResumeRatio, "PERCENT"), "Percent of queue's maximum capacity at which flow control is de-activated.") ("default-event-threshold-ratio", optValue(queueThresholdEventRatio, "%age of limit"), "The ratio of any specified queue limit at which an event will be raised"); } diff --git a/qpid/cpp/src/qpid/log/Logger.cpp b/qpid/cpp/src/qpid/log/Logger.cpp index 2217cdddbd..2339a62114 100644 --- a/qpid/cpp/src/qpid/log/Logger.cpp +++ b/qpid/cpp/src/qpid/log/Logger.cpp @@ -22,6 +22,7 @@ #include "qpid/memory.h" #include "qpid/sys/Thread.h" #include "qpid/sys/Time.h" +#include "qpid/DisableExceptionLogging.h" #include <boost/pool/detail/singleton.hpp> #include <boost/bind.hpp> #include <boost/function.hpp> @@ -48,11 +49,16 @@ Logger& Logger::instance() { } Logger::Logger() : flags(0) { + // Disable automatic logging in Exception constructors to avoid + // re-entrant use of logger singleton if there is an error in + // option parsing. + DisableExceptionLogging del; + // Initialize myself from env variables so all programs // (e.g. tests) can use logging even if they don't parse // command line args. Options opts(""); - opts.parse(0, 0); + opts.parse(0, 0); configure(opts); } @@ -73,7 +79,7 @@ void Logger::log(const Statement& s, const std::string& msg) { std::ostringstream os; if (!prefix.empty()) os << prefix << ": "; - if (flags&TIME) + if (flags&TIME) qpid::sys::outputFormattedNow(os); if (flags&LEVEL) os << LevelTraits::name(s.level) << " "; @@ -140,7 +146,7 @@ void Logger::configure(const Options& opts) { Options o(opts); if (o.trace) o.selectors.push_back("trace+"); - format(o); + format(o); select(Selector(o)); setPrefix(opts.prefix); options.sinkOptions->setup(this); diff --git a/qpid/cpp/src/qpid/sys/Timer.cpp b/qpid/cpp/src/qpid/sys/Timer.cpp index a97ccd1bd1..85e410860d 100644 --- a/qpid/cpp/src/qpid/sys/Timer.cpp +++ b/qpid/cpp/src/qpid/sys/Timer.cpp @@ -131,12 +131,14 @@ void Timer::run() bool warningsEnabled; QPID_LOG_TEST(warning, warningsEnabled); if (warningsEnabled) { - if (delay > late && overrun > overran) - warn.lateAndOverran(t->name, delay, overrun, Duration(start, end)); + if (overrun > overran) { + if (delay > overran) // if delay is significant to an overrun. + warn.lateAndOverran(t->name, delay, overrun, Duration(start, end)); + else + warn.overran(t->name, overrun, Duration(start, end)); + } else if (delay > late) warn.late(t->name, delay); - else if (overrun > overran) - warn.overran(t->name, overrun, Duration(start, end)); } continue; } else { diff --git a/qpid/cpp/src/qpid/sys/TimerWarnings.cpp b/qpid/cpp/src/qpid/sys/TimerWarnings.cpp index 48a56eb472..87c3169456 100644 --- a/qpid/cpp/src/qpid/sys/TimerWarnings.cpp +++ b/qpid/cpp/src/qpid/sys/TimerWarnings.cpp @@ -59,17 +59,19 @@ void TimerWarnings::log() { QPID_LOG(warning, task << " task late " << stats.lateDelay.count << " times by " << stats.lateDelay.average()/TIME_MSEC << "ms on average."); + if (stats.overranOverrun.count) QPID_LOG(warning, task << " task overran " << stats.overranOverrun.count << " times by " << stats.overranOverrun.average()/TIME_MSEC << "ms (taking " << stats.overranTime.average() << "ns) on average."); - if (stats.lateAndOverranDelay.count) - QPID_LOG(warning, task << " task overran " - << stats.overranOverrun.count << " times by " - << stats.overranOverrun.average()/TIME_MSEC << "ms (taking " - << stats.overranTime.average() << "ns) on average."); + if (stats.lateAndOverranOverrun.count) + QPID_LOG(warning, task << " task late and overran " + << stats.lateAndOverranOverrun.count << " times: late " + << stats.lateAndOverranDelay.average()/TIME_MSEC << "ms, overran " + << stats.lateAndOverranOverrun.average()/TIME_MSEC << "ms (taking " + << stats.lateAndOverranTime.average() << "ns) on average."); } nextReport = AbsTime(now(), interval); diff --git a/qpid/cpp/src/replication.mk b/qpid/cpp/src/replication.mk index dbe071f405..e5da32f88b 100644 --- a/qpid/cpp/src/replication.mk +++ b/qpid/cpp/src/replication.mk @@ -19,14 +19,14 @@ # Make file for building two plugins for asynchronously replicating # queues. -dmodule_LTLIBRARIES += replicating_listener.la replication_exchange.la +dmoduleexec_LTLIBRARIES += replicating_listener.la replication_exchange.la # a queue event listener plugin that creates messages on a replication # queue corresponding to enqueue and dequeue events: replicating_listener_la_SOURCES = \ qpid/replication/constants.h \ qpid/replication/ReplicatingEventListener.cpp \ - qpid/replication/ReplicatingEventListener.h + qpid/replication/ReplicatingEventListener.h replicating_listener_la_LIBADD = libqpidbroker.la if SUNOS @@ -41,7 +41,7 @@ replicating_listener_la_LDFLAGS = $(PLUGINLDFLAGS) replication_exchange_la_SOURCES = \ qpid/replication/constants.h \ qpid/replication/ReplicationExchange.cpp \ - qpid/replication/ReplicationExchange.h + qpid/replication/ReplicationExchange.h replication_exchange_la_LIBADD = libqpidbroker.la diff --git a/qpid/cpp/src/ssl.mk b/qpid/cpp/src/ssl.mk index 5fbdd55438..4dba9bb61c 100644 --- a/qpid/cpp/src/ssl.mk +++ b/qpid/cpp/src/ssl.mk @@ -18,7 +18,7 @@ # # # Makefile fragment, conditionally included in Makefile.am -# +# libsslcommon_la_SOURCES = \ qpid/sys/ssl/check.h \ qpid/sys/ssl/check.cpp \ @@ -47,7 +47,7 @@ ssl_la_CXXFLAGS=$(AM_CXXFLAGS) $(SSL_CFLAGS) ssl_la_LDFLAGS = $(PLUGINLDFLAGS) -dmodule_LTLIBRARIES += ssl.la +dmoduleexec_LTLIBRARIES += ssl.la sslconnector_la_SOURCES = \ qpid/client/SslConnector.cpp @@ -60,5 +60,5 @@ sslconnector_la_CXXFLAGS = $(AM_CXXFLAGS) -DQPIDC_CONF_FILE=\"$(confdir)/qpidc.c sslconnector_la_LDFLAGS = $(PLUGINLDFLAGS) -cmodule_LTLIBRARIES += \ +cmoduleexec_LTLIBRARIES += \ sslconnector.la diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py index e1ee6d4a23..39eec466f2 100644 --- a/qpid/cpp/src/tests/brokertest.py +++ b/qpid/cpp/src/tests/brokertest.py @@ -509,6 +509,10 @@ class BrokerTest(TestCase): r.close() self.assertEqual(expect_contents, actual_contents) +def join(thread, timeout=1): + thread.join(timeout) + if thread.isAlive(): raise Exception("Timed out joining thread %s"%thread) + class RethrownException(Exception): """Captures the stack trace of the current exception to be thrown later""" def __init__(self, msg=""): @@ -526,7 +530,7 @@ class StoppableThread(Thread): def stop(self): self.stopped = True - self.join() + join(self) if self.error: raise self.error class NumberedSender(Thread): @@ -585,7 +589,7 @@ class NumberedSender(Thread): self.stopped = True self.condition.notify() finally: self.condition.release() - self.join() + join(self) self.write_message(-1) # end-of-messages marker. if self.error: raise self.error @@ -632,7 +636,7 @@ class NumberedReceiver(Thread): def stop(self): """Returns when termination message is received""" - self.join() + join(self) if self.error: raise self.error class ErrorGenerator(StoppableThread): diff --git a/qpid/cpp/src/tests/sasl_fed b/qpid/cpp/src/tests/sasl_fed index 9845a20838..884c44177c 100755 --- a/qpid/cpp/src/tests/sasl_fed +++ b/qpid/cpp/src/tests/sasl_fed @@ -123,7 +123,7 @@ n_messages=100 #-------------------------------------------------- #echo " Sending 100 messages to $broker_1_port " #-------------------------------------------------- -$builddir/datagen --count $n_messages | $SENDER_EXEC --username zag --password zag --exchange $EXCHANGE_NAME --routing-key $ROUTING_KEY --port $broker_1_port +$builddir/datagen --count $n_messages | $SENDER_EXEC --mechanism DIGEST-MD5 --username zag --password zag --exchange $EXCHANGE_NAME --routing-key $ROUTING_KEY --port $broker_1_port sleep 5 diff --git a/qpid/cpp/src/tests/sasl_fed_ex b/qpid/cpp/src/tests/sasl_fed_ex index 71dece56a9..272b42cd0d 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex +++ b/qpid/cpp/src/tests/sasl_fed_ex @@ -160,7 +160,7 @@ export QPID_SSL_CERT_NAME=${TEST_HOSTNAME} COMMON_BROKER_OPTIONS=" \ --ssl-sasl-no-dict \ - --sasl-config=$sasl_config_dir \ + --sasl-config=$sasl_config_dir \ --ssl-require-client-authentication \ --auth yes \ --ssl-cert-db $CERT_DIR \ @@ -169,7 +169,6 @@ COMMON_BROKER_OPTIONS=" \ --no-data-dir \ --no-module-dir \ --load-module ${SSL_LIB} \ - --load-module ${CLUSTER_LIB} \ --mgmt-enable=yes \ --log-enable info+ \ --log-source yes \ @@ -186,6 +185,7 @@ function start_brokers { --port=${SRC_TCP_PORT} \ --ssl-port ${SRC_SSL_PORT} \ ${COMMON_BROKER_OPTIONS} \ + --load-module ${CLUSTER_LIB} \ --cluster-name ${CLUSTER_1_NAME} \ --log-to-file $tmp_root/qpidd_src.log 2> /dev/null @@ -196,6 +196,7 @@ function start_brokers { --port=${SRC_TCP_PORT_2} \ --ssl-port ${SRC_SSL_PORT_2} \ ${COMMON_BROKER_OPTIONS} \ + --load-module ${CLUSTER_LIB} \ --cluster-name ${CLUSTER_1_NAME} \ --log-to-file $tmp_root/qpidd_src_2.log 2> /dev/null @@ -209,6 +210,7 @@ function start_brokers { --port=${DST_TCP_PORT} \ --ssl-port ${DST_SSL_PORT} \ ${COMMON_BROKER_OPTIONS} \ + --load-module ${CLUSTER_LIB} \ --cluster-name ${CLUSTER_2_NAME} \ --log-to-file $tmp_root/qpidd_dst.log 2> /dev/null @@ -219,6 +221,7 @@ function start_brokers { --port=${DST_TCP_PORT_2} \ --ssl-port ${DST_SSL_PORT_2} \ ${COMMON_BROKER_OPTIONS} \ + --load-module ${CLUSTER_LIB} \ --cluster-name ${CLUSTER_2_NAME} \ --log-to-file $tmp_root/qpidd_dst_2.log 2> /dev/null @@ -329,12 +332,10 @@ halt_brokers sleep 1 -print "Removing temporary directory $tmp_root" -rm -rf $tmp_root - - if [ ${link_status} == "Operational" ]; then print "result: good" + print "Removing temporary directory $tmp_root" + rm -rf $tmp_root exit 0 fi diff --git a/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster b/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster index 273a543ec5..b0cceccecb 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster +++ b/qpid/cpp/src/tests/sasl_fed_ex_dynamic_cluster @@ -21,7 +21,8 @@ source ./test_env.sh +source $srcdir/ais_check -${srcdir}/sasl_fed_ex dynamic cluster +with_ais_group ${srcdir}/sasl_fed_ex dynamic cluster diff --git a/qpid/cpp/src/tests/sasl_fed_ex_link_cluster b/qpid/cpp/src/tests/sasl_fed_ex_link_cluster index 0e037b1969..4139300b12 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex_link_cluster +++ b/qpid/cpp/src/tests/sasl_fed_ex_link_cluster @@ -21,7 +21,8 @@ source ./test_env.sh +source $srcdir/ais_check -${srcdir}/sasl_fed_ex link cluster +with_ais_group ${srcdir}/sasl_fed_ex link cluster diff --git a/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster b/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster index ec8750b861..f251420e08 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster +++ b/qpid/cpp/src/tests/sasl_fed_ex_queue_cluster @@ -21,7 +21,8 @@ source ./test_env.sh +source ${srcdir}/ais_check -${srcdir}/sasl_fed_ex queue cluster +with_ais_group ${srcdir}/sasl_fed_ex queue cluster diff --git a/qpid/cpp/src/tests/sasl_fed_ex_route_cluster b/qpid/cpp/src/tests/sasl_fed_ex_route_cluster index fd59680b6e..a5d1542def 100755 --- a/qpid/cpp/src/tests/sasl_fed_ex_route_cluster +++ b/qpid/cpp/src/tests/sasl_fed_ex_route_cluster @@ -21,7 +21,8 @@ source ./test_env.sh +source ${srcdir}/ais_check -${srcdir}/sasl_fed_ex route cluster +with_ais_group ${srcdir}/sasl_fed_ex route cluster diff --git a/qpid/cpp/src/xml.mk b/qpid/cpp/src/xml.mk index 0d700fcc03..baf3803647 100644 --- a/qpid/cpp/src/xml.mk +++ b/qpid/cpp/src/xml.mk @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # -dmodule_LTLIBRARIES += xml.la +dmoduleexec_LTLIBRARIES += xml.la xml_la_SOURCES = \ qpid/xml/XmlExchange.cpp \ |
