You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/11/03 19:59:02 UTC
[1/3] qpid-dispatch git commit: DISPATCH-553 - Resolve the issue of
concurrent access to the message-annotations when fanout is greater than one.
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 3b73b03c0 -> 3eae0e137
DISPATCH-553 - Resolve the issue of concurrent access to the message-annotations when fanout is greater than one.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/bbcfea04
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/bbcfea04
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/bbcfea04
Branch: refs/heads/master
Commit: bbcfea048643fd382e39f1fb8920ee12d69d2fb0
Parents: 3b73b03
Author: Ted Ross <tr...@redhat.com>
Authored: Thu Nov 3 10:41:07 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Nov 3 10:41:07 2016 -0400
----------------------------------------------------------------------
include/qpid/dispatch/ctools.h | 1 +
include/qpid/dispatch/parse.h | 8 +++++++
src/message.c | 9 ++++----
src/parse.c | 43 +++++++++++++++++++++++++++++++------
4 files changed, 51 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbcfea04/include/qpid/dispatch/ctools.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/ctools.h b/include/qpid/dispatch/ctools.h
index 863033b..1b5d0d3 100644
--- a/include/qpid/dispatch/ctools.h
+++ b/include/qpid/dispatch/ctools.h
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <assert.h>
+#include <memory.h>
#define CT_ASSERT(exp) { assert(exp); }
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbcfea04/include/qpid/dispatch/parse.h
----------------------------------------------------------------------
diff --git a/include/qpid/dispatch/parse.h b/include/qpid/dispatch/parse.h
index d38a5fa..d4fdf42 100644
--- a/include/qpid/dispatch/parse.h
+++ b/include/qpid/dispatch/parse.h
@@ -50,6 +50,14 @@ qd_parsed_field_t *qd_parse(qd_field_iterator_t *iter);
void qd_parse_free(qd_parsed_field_t *field);
/**
+ * Create a duplicate parsed field, referring to the same base data.
+ *
+ * @param field A field pointer returned by qd_parse.
+ * @return A separate field that is a duplicate of the supplied field.
+ */
+qd_parsed_field_t *qd_parse_dup(const qd_parsed_field_t *field);
+
+/**
* Check to see if the field parse was successful (i.e. the field was
* well-formed).
*
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbcfea04/src/message.c
----------------------------------------------------------------------
diff --git a/src/message.c b/src/message.c
index 33f0ea9..03586ee 100644
--- a/src/message.c
+++ b/src/message.c
@@ -559,8 +559,8 @@ qd_message_t *qd_message()
return 0;
}
- memset(msg->content, 0, sizeof(qd_message_content_t));
- msg->content->lock = sys_mutex();
+ ZERO(msg->content);
+ msg->content->lock = sys_mutex();
sys_atomic_init(&msg->content->ref_count, 1);
msg->content->parse_depth = QD_DEPTH_NONE;
msg->content->parsed_message_annotations = 0;
@@ -796,8 +796,7 @@ static void compose_message_annotations(qd_message_pvt_t *msg, qd_buffer_list_t
bool map_started = false;
//We will have to add the custom annotations
- qd_parsed_field_t *in_ma = msg->content->parsed_message_annotations;
-
+ qd_parsed_field_t *in_ma = qd_parse_dup(msg->content->parsed_message_annotations);
if (in_ma) {
uint32_t count = qd_parse_sub_count(in_ma);
@@ -818,6 +817,8 @@ static void compose_message_annotations(qd_message_pvt_t *msg, qd_buffer_list_t
qd_compose_insert_typed_iterator(out_ma, qd_parse_typed(sub_value));
}
}
+
+ qd_parse_free(in_ma);
}
//Add the dispatch router specific annotations only if strip_annotations is false.
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/bbcfea04/src/parse.c
----------------------------------------------------------------------
diff --git a/src/parse.c b/src/parse.c
index 091c32e..d185d52 100644
--- a/src/parse.c
+++ b/src/parse.c
@@ -26,12 +26,12 @@ DEQ_DECLARE(qd_parsed_field_t, qd_parsed_field_list_t);
struct qd_parsed_field_t {
DEQ_LINKS(qd_parsed_field_t);
- qd_parsed_field_t *parent;
- qd_parsed_field_list_t children;
- uint8_t tag;
- qd_field_iterator_t *raw_iter;
- qd_field_iterator_t *typed_iter;
- const char *parse_error;
+ const qd_parsed_field_t *parent;
+ qd_parsed_field_list_t children;
+ uint8_t tag;
+ qd_field_iterator_t *raw_iter;
+ qd_field_iterator_t *typed_iter;
+ const char *parse_error;
};
ALLOC_DECLARE(qd_parsed_field_t);
@@ -194,6 +194,37 @@ void qd_parse_free(qd_parsed_field_t *field)
}
+static qd_parsed_field_t *qd_parse_dup_internal(const qd_parsed_field_t *field, const qd_parsed_field_t *parent)
+{
+ qd_parsed_field_t *dup = new_qd_parsed_field_t();
+
+ if (dup == 0)
+ return 0;
+
+ ZERO(dup);
+ dup->parent = parent;
+ dup->tag = field->tag;
+ dup->raw_iter = qd_field_iterator_dup(field->raw_iter);
+ dup->typed_iter = qd_field_iterator_dup(field->typed_iter);
+ dup->parse_error = field->parse_error;
+
+ qd_parsed_field_t *child = DEQ_HEAD(field->children);
+ while (child) {
+ qd_parsed_field_t *dup_child = qd_parse_dup_internal(child, field);
+ DEQ_INSERT_TAIL(dup->children, dup_child);
+ child = DEQ_NEXT(child);
+ }
+
+ return dup;
+}
+
+
+qd_parsed_field_t *qd_parse_dup(const qd_parsed_field_t *field)
+{
+ return field ? qd_parse_dup_internal(field, 0) : 0;
+}
+
+
int qd_parse_ok(qd_parsed_field_t *field)
{
return field->parse_error == 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/3] qpid-dispatch git commit: DISPATCH-558 - Removed assertions in
core agent that can fail with malformed queries.
Posted by tr...@apache.org.
DISPATCH-558 - Removed assertions in core agent that can fail with malformed queries.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/ff07004d
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/ff07004d
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/ff07004d
Branch: refs/heads/master
Commit: ff07004d960a6ebbb4f9d1ec9606a93cac372c5e
Parents: bbcfea0
Author: Ted Ross <tr...@redhat.com>
Authored: Thu Nov 3 15:46:48 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Nov 3 15:46:48 2016 -0400
----------------------------------------------------------------------
src/router_core/agent.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ff07004d/src/router_core/agent.c
----------------------------------------------------------------------
diff --git a/src/router_core/agent.c b/src/router_core/agent.c
index 16dd30b..5b46e01 100644
--- a/src/router_core/agent.c
+++ b/src/router_core/agent.c
@@ -245,8 +245,8 @@ static void qdr_agent_emit_columns(qdr_query_t *query, const char *qdr_columns[]
qd_compose_start_list(query->body);
int i = 0;
while (query->columns[i] >= 0) {
- assert(query->columns[i] < column_count);
- qd_compose_insert_string(query->body, qdr_columns[query->columns[i]]);
+ if (query->columns[i] < column_count)
+ qd_compose_insert_string(query->body, qdr_columns[query->columns[i]]);
i++;
}
qd_compose_end_list(query->body);
@@ -266,11 +266,12 @@ static void qdr_agent_set_columns(qdr_query_t *query,
// Either the attribute_names field is absent, it's not a list, or it's an empty list.
// In this case, we will include all available attributes.
//
+ if (column_count > QDR_AGENT_MAX_COLUMNS)
+ column_count = QDR_AGENT_MAX_COLUMNS;
int i;
for (i = 0; i < column_count; i++)
query->columns[i] = i;
query->columns[i] = -1;
- assert(i < QDR_AGENT_MAX_COLUMNS);
return;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[3/3] qpid-dispatch git commit: DISPATCH-559 - Update qdstat to only
request the attributes that will be used in the display.
Posted by tr...@apache.org.
DISPATCH-559 - Update qdstat to only request the attributes that will be used in the display.
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/3eae0e13
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/3eae0e13
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/3eae0e13
Branch: refs/heads/master
Commit: 3eae0e137c0c4f94c25e9a0badbc6e6fdb24aab9
Parents: ff07004
Author: Ted Ross <tr...@redhat.com>
Authored: Thu Nov 3 15:49:11 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Thu Nov 3 15:49:11 2016 -0400
----------------------------------------------------------------------
tools/qdstat | 36 ++++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/3eae0e13/tools/qdstat
----------------------------------------------------------------------
diff --git a/tools/qdstat b/tools/qdstat
index 92f0a8d..ee9f6b1 100755
--- a/tools/qdstat
+++ b/tools/qdstat
@@ -74,8 +74,13 @@ class BusManager(Node):
ssl_domain=opts_ssl_domain(opts),
sasl=opts_sasl(self.opts)))
- def query(self, entity_type):
- return super(BusManager, self).query(entity_type).get_entities()
+ def query(self, entity_type, attribute_names=None):
+ if attribute_names:
+ unames = []
+ for a in attribute_names:
+ unames.append(unicode(a))
+ attribute_names = unames
+ return super(BusManager, self).query(entity_type, attribute_names).get_entities()
def connAuth(self, conn):
##
@@ -239,7 +244,11 @@ class BusManager(Node):
heads.append(Header("name"))
rows = []
- objects = self.query('org.apache.qpid.dispatch.router.link')
+ cols = ('linkType', 'linkDir', 'connectionId', 'identity', 'peer', 'owningAddr',
+ 'capacity', 'undeliveredCount', 'unsettledCount', 'deliveryCount',
+ 'presettledCount', 'acceptedCount', 'rejectedCount', 'releasedCount',
+ 'modifiedCount', 'adminStatus', 'operStatus', 'linkName')
+ objects = self.query('org.apache.qpid.dispatch.router.link', cols)
for link in objects:
row = []
@@ -281,7 +290,10 @@ class BusManager(Node):
heads.append(Header("valid-origins"))
rows = []
- objects = self.query('org.apache.qpid.dispatch.router.node')
+ cols = ('id', 'nextHop', 'routerLink')
+ if self.opts.verbose:
+ cols += ('cost', 'linkState', 'validOrigins')
+ objects = self.query('org.apache.qpid.dispatch.router.node', cols)
for node in objects:
row = []
@@ -324,7 +336,10 @@ class BusManager(Node):
heads.append(Header("from-proc", Header.COMMAS))
rows = []
- objects = self.query('org.apache.qpid.dispatch.router.address')
+ cols = ('distribution', 'inProcess', 'subscriberCount', 'remoteCount',
+ 'containerCount', 'deliveriesIngress', 'deliveriesEgress',
+ 'deliveriesTransit', 'deliveriesToContainer', 'deliveriesFromContainer')
+ objects = self.query('org.apache.qpid.dispatch.router.address', cols)
for addr in objects:
row = []
@@ -359,7 +374,8 @@ class BusManager(Node):
heads.append(Header("lastErr"))
rows = []
- objects = self.query('org.apache.qpid.dispatch.router.config.autoLink')
+ cols = ('addr', 'dir', 'phase', 'externalAddr', 'linkRef', 'operStatus', 'lastError')
+ objects = self.query('org.apache.qpid.dispatch.router.config.autoLink', cols)
for al in objects:
row = []
@@ -385,7 +401,8 @@ class BusManager(Node):
heads.append(Header("status"))
rows = []
- link_routes = self.query('org.apache.qpid.dispatch.router.config.linkRoute')
+ cols = ('prefix', 'dir', 'distribution', 'operStatus')
+ link_routes = self.query('org.apache.qpid.dispatch.router.config.linkRoute', cols)
for link_route in link_routes:
row = []
@@ -412,7 +429,10 @@ class BusManager(Node):
heads.append(Header("rebal-out", Header.COMMAS))
rows = []
- objects = self.query('org.apache.qpid.dispatch.allocator')
+ cols = ('identity', 'typeSize', 'transferBatchSize', 'localFreeListMax',
+ 'totalAllocFromHeap', 'heldByThreads', 'batchesRebalancedToThreads',
+ 'batchesRebalancedToGlobal')
+ objects = self.query('org.apache.qpid.dispatch.allocator', cols)
for t in objects:
row = []
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org