[qpid-proton] branch master updated: PROTON-2140: Lazy creation of various link related objects to reduce per-link memory overhead

2019-11-21 Thread gsim
This is an automated email from the ASF dual-hosted git repository.

gsim pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
 new add5ed2  PROTON-2140: Lazy creation of various link related objects to 
reduce per-link memory overhead
add5ed2 is described below

commit add5ed2c4675d8138998ed421ba358731b729fc3
Author: Gordon Sim 
AuthorDate: Wed Nov 20 12:55:48 2019 +

PROTON-2140: Lazy creation of various link related objects to reduce 
per-link memory overhead
---
 c/src/core/codec.c | 88 --
 c/src/core/engine.c| 79 
 c/src/core/transport.c | 10 --
 3 files changed, 136 insertions(+), 41 deletions(-)

diff --git a/c/src/core/codec.c b/c/src/core/codec.c
index 300dd3d..cbc2360 100644
--- a/c/src/core/codec.c
+++ b/c/src/core/codec.c
@@ -364,6 +364,38 @@ static int pn_data_inspect(void *obj, pn_string_t *dst)
 #define pn_data_hashcode NULL
 #define pn_data_compare NULL
 
+static inline pn_string_t *pni_data_str(pn_data_t *data)
+{
+  if (data->str == NULL) {
+data->str = pn_string(NULL);
+  }
+  return data->str;
+}
+
+static inline pn_decoder_t *pni_data_decoder(pn_data_t *data)
+{
+  if (data->decoder == NULL) {
+data->decoder = pn_decoder();
+  }
+  return data->decoder;
+}
+
+static inline pn_encoder_t *pni_data_encoder(pn_data_t *data)
+{
+  if (data->encoder == NULL) {
+data->encoder = pn_encoder();
+  }
+  return data->encoder;
+}
+
+static inline pn_error_t *pni_data_error(pn_data_t *data)
+{
+  if (data->error == NULL) {
+data->error = pn_error();
+  }
+  return data->error;
+}
+
 pn_data_t *pn_data(size_t capacity)
 {
   static const pn_class_t clazz = PN_CLASS(pn_data);
@@ -371,15 +403,15 @@ pn_data_t *pn_data(size_t capacity)
   data->capacity = capacity;
   data->size = 0;
   data->nodes = capacity ? (pni_node_t *) malloc(capacity * 
sizeof(pni_node_t)) : NULL;
-  data->buf = pn_buffer(64);
+  data->buf = NULL;
   data->parent = 0;
   data->current = 0;
   data->base_parent = 0;
   data->base_current = 0;
-  data->decoder = pn_decoder();
-  data->encoder = pn_encoder();
-  data->error = pn_error();
-  data->str = pn_string(NULL);
+  data->decoder = NULL;
+  data->encoder = NULL;
+  data->error = NULL;
+  data->str = NULL;
   return data;
 }
 
@@ -390,12 +422,12 @@ void pn_data_free(pn_data_t *data)
 
 int pn_data_errno(pn_data_t *data)
 {
-  return pn_error_code(data->error);
+  return pn_error_code(pni_data_error(data));
 }
 
 pn_error_t *pn_data_error(pn_data_t *data)
 {
-  return data->error;
+  return pni_data_error(data);
 }
 
 size_t pn_data_size(pn_data_t *data)
@@ -411,7 +443,7 @@ void pn_data_clear(pn_data_t *data)
 data->current = 0;
 data->base_parent = 0;
 data->base_current = 0;
-pn_buffer_clear(data->buf);
+if (data->buf) pn_buffer_clear(data->buf);
   }
 }
 
@@ -431,6 +463,9 @@ static int pni_data_grow(pn_data_t *data)
 
 static ssize_t pni_data_intern(pn_data_t *data, const char *start, size_t size)
 {
+  if (data->buf == NULL) {
+data->buf = pn_buffer(size);
+  }
   size_t offset = pn_buffer_size(data->buf);
   int err = pn_buffer_append(data->buf, start, size);
   if (err) return err;
@@ -465,6 +500,9 @@ static int pni_data_intern_node(pn_data_t *data, pni_node_t 
*node)
 {
   pn_bytes_t *bytes = pni_data_bytes(data, node);
   if (!bytes) return 0;
+  if (data->buf == NULL) {
+data->buf = pn_buffer(bytes->size);
+  }
   size_t oldcap = pn_buffer_capacity(data->buf);
   ssize_t offset = pni_data_intern(data, bytes->start, bytes->size);
   if (offset < 0) return offset;
@@ -655,7 +693,7 @@ int pn_data_vfill(pn_data_t *data, const char *fmt, va_list 
ap)
 if (parent->atom.type == PN_ARRAY) {
   parent->type = (pn_type_t) va_arg(ap, int);
 } else {
-  return pn_error_format(data->error, PN_ERR, "naked type");
+  return pn_error_format(pni_data_error(data), PN_ERR, "naked type");
 }
   }
   break;
@@ -687,7 +725,7 @@ int pn_data_vfill(pn_data_t *data, const char *fmt, va_list 
ap)
 case '}':
 case ']':
   if (!pn_data_exit(data))
-return pn_error_format(data->error, PN_ERR, "exit failed");
+return pn_error_format(pni_data_error(data), PN_ERR, "exit failed");
   break;
 case '?':
   if (!va_arg(ap, int)) {
@@ -1123,7 +1161,7 @@ int pn_data_vscan(pn_data_t *data, const char *fmt, 
va_list ap)
 case '}':
   level--;
   if (!suspend && !pn_data_exit(data))
-return pn_error_format(data->error, PN_ERR, "exit failed");
+return pn_error_format(pni_data_error(data), PN_ERR, "exit failed");
   if (resume_count && level == count_level) resume_count--;
   break;
 case '.':
@@ -1133,7 +1171,7 @@ int pn_data_vscan(pn_data_t *data, const char *fmt, 
va_list ap)
   break;
 case 

[qpid-dispatch] branch master updated: DISPATCH-1438: dump the router debug dump file on router exit

2019-11-21 Thread kgiusti
This is an automated email from the ASF dual-hosted git repository.

kgiusti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
 new 40303c2  DISPATCH-1438: dump the router debug dump file on router exit
40303c2 is described below

commit 40303c20834ab4ec8ef8c1c8afa548b29c8a13da
Author: Kenneth Giusti 
AuthorDate: Fri Nov 8 14:59:29 2019 -0500

DISPATCH-1438: dump the router debug dump file on router exit

When the router is built for Debug (-DCMAKE_BUILD_TYPE=Debug) it
creates a dump file on shutdown that contains debug information.  This
patch updates ctest to dump the file to stderr when the "-V" (verbose)
flag is used.

This closes #621
---
 tests/system_test.py | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tests/system_test.py b/tests/system_test.py
index 56094b6..ab8e987 100755
--- a/tests/system_test.py
+++ b/tests/system_test.py
@@ -399,7 +399,8 @@ class Qdrouterd(Process):
 if not name: name = self.config.router_id
 assert name
 # setup log and debug dump files
-self.config.sections('router')[0]['debugDumpFile'] = '%s-qddebug.txt' 
% name
+self.dumpfile = os.path.abspath('%s-qddebug.txt' % name)
+self.config.sections('router')[0]['debugDumpFile'] = self.dumpfile
 default_log = [l for l in config if (l[0] == 'log' and l[1]['module'] 
== 'DEFAULT')]
 if not default_log:
 config.append(
@@ -435,6 +436,20 @@ class Qdrouterd(Process):
 
 super(Qdrouterd, self).teardown()
 
+# check router's debug dump file for anything interesting (should be
+# empty) and dump it to stderr for perusal by organic lifeforms
+try:
+if os.stat(self.dumpfile).st_size > 0:
+with open(self.dumpfile) as f:
+sys.stderr.write("\nRouter %s debug dump file:\n" % 
self.config.router_id)
+sys.stderr.write(f.read())
+sys.stderr.flush()
+except OSError:
+# failed to open file.  This can happen when an individual test
+# spawns a temporary router (i.e. not created as part of the
+# TestCase setUpClass method) that gets cleaned up by the test.
+pass
+
 @property
 def ports_family(self):
 """


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] branch master updated: DISPATCH-1485 - Setting limit=0 on qdstat means setting the limit to unlimited. Fixed infinite loop. This closes #622.

2019-11-21 Thread gmurthy
This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/master by this push:
 new 47d38c1  DISPATCH-1485 - Setting limit=0 on qdstat means setting the 
limit to unlimited. Fixed infinite loop. This closes #622.
47d38c1 is described below

commit 47d38c1720bd084aab150db03f5d0070b11ddc44
Author: Ganesh Murthy 
AuthorDate: Tue Nov 19 16:08:30 2019 -0500

DISPATCH-1485 - Setting limit=0 on qdstat means setting the limit to 
unlimited. Fixed infinite loop. This closes #622.
---
 python/qpid_dispatch/management/client.py  |  2 +-
 python/qpid_dispatch_internal/tools/command.py |  2 +-
 tests/system_tests_qdstat.py   | 11 +++
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/python/qpid_dispatch/management/client.py 
b/python/qpid_dispatch/management/client.py
index 3fc8364..570a8b6 100644
--- a/python/qpid_dispatch/management/client.py
+++ b/python/qpid_dispatch/management/client.py
@@ -244,7 +244,7 @@ class Node(object):
 if offset is None:
 offset = 0
 
-if count is None:
+if count is None or count==0:
 # count has not been specified. For each request the
 # maximum number of rows we can get without proton
 # failing is MAX_ALLOWED_COUNT_PER_REQUEST
diff --git a/python/qpid_dispatch_internal/tools/command.py 
b/python/qpid_dispatch_internal/tools/command.py
index 55abb9f..bb98196 100644
--- a/python/qpid_dispatch_internal/tools/command.py
+++ b/python/qpid_dispatch_internal/tools/command.py
@@ -182,7 +182,7 @@ def _qdstat_parser(BusManager):
 # can be used in conjunction with options
 # like -c, -l, -a, --autolinks, --linkroutes and --log.
 # By default, the limit is not set, which means the limit is unlimited.
-parser.add_argument("--limit", help="Limit number of output rows", 
type=int, default=None)
+parser.add_argument("--limit", help="Limit number of output rows. 
Unlimited if limit is zero or if limit not specified", type=int, default=None)
 
 add_connection_options(parser)
 return parser
diff --git a/tests/system_tests_qdstat.py b/tests/system_tests_qdstat.py
index 9bee375..d3ec87d 100644
--- a/tests/system_tests_qdstat.py
+++ b/tests/system_tests_qdstat.py
@@ -241,6 +241,17 @@ class QdstatTest(system_test.TestCase):
 
 self.assertEqual(links, 500)
 
+# DISPATCH-1485. Try to run qdstat with a limit=0. Without the fix for 
DISPATCH-1485
+# this following command will hang and the test will fail.
+outs = self.run_qdstat(['--links', '--limit=0'])
+out_list = outs.split("\n")
+
+links = 0
+for out in out_list:
+if "endpoint" in out and "examples" in out:
+links += 1
+self.assertEqual(links, COUNT*2)
+
 
 # This test would fail without the fix for DISPATCH-974
 outs = self.run_qdstat(['--address'])


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-dispatch] branch eallen-DISPATCH-1385 updated: adding browserslist as a dev dependancy

2019-11-21 Thread eallen
This is an automated email from the ASF dual-hosted git repository.

eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/eallen-DISPATCH-1385 by this 
push:
 new c08ec17  adding browserslist as a dev dependancy
c08ec17 is described below

commit c08ec171a838ffe83f3d0f1e3529dcc578eb3fa9
Author: Ernest Allen 
AuthorDate: Thu Nov 21 07:53:41 2019 -0500

adding browserslist as a dev dependancy
---
 console/react/package.json |  5 +++--
 console/react/yarn.lock| 21 -
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/console/react/package.json b/console/react/package.json
index 033aebf..4ab79c5 100644
--- a/console/react/package.json
+++ b/console/react/package.json
@@ -45,12 +45,13 @@
 ]
   },
   "devDependencies": {
-"jest-axe": "^3.2.0",
-"eslint-plugin-patternfly-react": "^0.2.3",
 "@react-mock/localstorage": "^0.1.2",
 "@testing-library/jest-dom": "^4.2.3",
 "@testing-library/react": "^9.3.2",
 "body-parser": "^1.19.0",
+"eslint-plugin-patternfly-react": "^0.2.3",
+"browserslist": "^4.7.3",
+"jest-axe": "^3.2.0",
 "prettier": "^1.19.1"
   }
 }
diff --git a/console/react/yarn.lock b/console/react/yarn.lock
index 6230861..4b449d8 100644
--- a/console/react/yarn.lock
+++ b/console/react/yarn.lock
@@ -3242,6 +3242,15 @@ browserslist@^4.0.0, browserslist@^4.1.1, 
browserslist@^4.6.0, browserslist@^4.6
 electron-to-chromium "^1.3.295"
 node-releases "^1.1.38"
 
+browserslist@^4.7.3:
+  version "4.7.3"
+  resolved 
"https://registry.yarnpkg.com/browserslist/-/browserslist-4.7.3.tgz#02341f162b6bcc1e1028e30624815d4924442dc3;
+  integrity 
sha512-jWvmhqYpx+9EZm/FxcZSbUZyDEvDTLDi3nSAKbzEkyWvtI0mNSmUosey+5awDW1RUlrgXbQb5A6qY1xQH9U6MQ==
+  dependencies:
+caniuse-lite "^1.0.30001010"
+electron-to-chromium "^1.3.306"
+node-releases "^1.1.40"
+
 bser@^2.0.0:
   version "2.1.1"
   resolved 
"https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05;
@@ -3403,6 +3412,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.3981, 
caniuse-lite@^1.0.3989, can
   resolved 
"https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001010.tgz#397a14034d384260453cc81994f494626d34b938;
   integrity 
sha512-RA5GH9YjFNea4ZQszdWgh2SC+dpLiRAg4VDQS2b5JRI45OxmbGrYocYHTa9x0bKMQUE7uvHkNPNffUr+pCxSGw==
 
+caniuse-lite@^1.0.30001010:
+  version "1.0.30001011"
+  resolved 
"https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001011.tgz#0d6c4549c78c4a800bb043a83ca0cbe0aee6c6e1;
+  integrity 
sha512-h+Eqyn/YA6o6ZTqpS86PyRmNWOs1r54EBDcd2NTwwfsXQ8re1B38SnB+p2RKF8OUsyEIjeDU8XGec1RGO/wYCg==
+
 capture-exit@^2.0.0:
   version "2.0.0"
   resolved 
"https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4;
@@ -4705,6 +4719,11 @@ electron-to-chromium@^1.3.247, 
electron-to-chromium@^1.3.295:
   resolved 
"https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.306.tgz#e8265301d053d5f74e36cb876486830261fbe946;
   integrity 
sha512-frDqXvrIROoYvikSKTIKbHbzO6M3/qC6kCIt/1FOa9kALe++c4VAJnwjSFvf1tYLEUsP2n9XZ4XSCyqc3l7A/A==
 
+electron-to-chromium@^1.3.306:
+  version "1.3.309"
+  resolved 
"https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.309.tgz#9e1e5e23c73d04f0364e524afaafd6659289ae1b;
+  integrity 
sha512-NZd91XD15v2UPLjYXoN/gLnkwIUQjdH4SQLpRCCQiYJH6BBkfgp5pWemBJPr1rZ2dl8Ee3o91O9Sa1QuAfZmog==
+
 elliptic@^6.0.0:
   version "6.5.1"
   resolved 
"https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.1.tgz#c380f5f909bf1b9b4428d028cd18d3b0efd6b52b;
@@ -8215,7 +8234,7 @@ node-pre-gyp@^0.12.0:
 semver "^5.3.0"
 tar "^4"
 
-node-releases@^1.1.29, node-releases@^1.1.38:
+node-releases@^1.1.29, node-releases@^1.1.38, node-releases@^1.1.40:
   version "1.1.40"
   resolved 
"https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.40.tgz#a94facfa8e2d612302601ca1361741d529c4515a;
   integrity 
sha512-r4LPcC5b/bS8BdtWH1fbeK88ib/wg9aqmg6/s3ngNLn2Ewkn/8J6Iw3P9RTlfIAdSdvYvQl2thCY5Y+qTAQ2iQ==


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org



[qpid-broker-j] branch master updated: QPID-8382 : Allow for making attribute injectors type specific

2019-11-21 Thread rgodfrey
This is an automated email from the ASF dual-hosted git repository.

rgodfrey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git


The following commit(s) were added to refs/heads/master by this push:
 new cf12504  QPID-8382 : Allow for making attribute injectors type specific
cf12504 is described below

commit cf1250432e74b7793182b7b7970fe07419647e09
Author: rgodfrey 
AuthorDate: Thu Nov 21 12:58:47 2019 +0100

QPID-8382 : Allow for making attribute injectors type specific
---
 .../qpid/server/model/BrokerAttributeInjector.java | 16 ++--
 .../server/model/ConfiguredObjectTypeRegistry.java | 29 --
 .../plugin/ConfiguredObjectAttributeInjector.java  |  6 +
 3 files changed, 29 insertions(+), 22 deletions(-)

diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
index a2d5278..8208973 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/model/BrokerAttributeInjector.java
@@ -50,15 +50,7 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 {
 private static final Logger LOGGER = 
LoggerFactory.getLogger(BrokerAttributeInjector.class);
 
-private final InjectedAttributeOrStatistic.TypeValidator _typeValidator =
-new InjectedAttributeOrStatistic.TypeValidator()
-{
-@Override
-public boolean appliesToType(final Class> type)
-{
-return Broker.class.isAssignableFrom(type);
-}
-};
+private final InjectedAttributeOrStatistic.TypeValidator _typeValidator = 
Broker.class::isAssignableFrom;
 
 private final Class _hotSpotDiagnosticMXBeanClass;
 private final PlatformManagedObject _hotSpotDiagnosticMXBean;
@@ -86,6 +78,12 @@ public class BrokerAttributeInjector implements 
ConfiguredObjectAttributeInjecto
 }
 
 @Override
+public InjectedAttributeStatisticOrOperation.TypeValidator 
getTypeValidator()
+{
+return _typeValidator;
+}
+
+@Override
 public Collection> 
getInjectedAttributes()
 {
 List> attributes = new 
ArrayList<>();
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
 
b/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
index 65b8d23..79b5fc6 100644
--- 
a/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
+++ 
b/broker-core/src/main/java/org/apache/qpid/server/model/ConfiguredObjectTypeRegistry.java
@@ -815,27 +815,30 @@ public class ConfiguredObjectTypeRegistry
 
 for (ConfiguredObjectAttributeInjector injector : _attributeInjectors)
 {
-for (ConfiguredObjectInjectedAttribute attr : 
injector.getInjectedAttributes())
+if (injector.getTypeValidator().appliesToType((Class>) clazz))
 {
-if (attr.appliesToConfiguredObjectType((Class>) clazz))
+for (ConfiguredObjectInjectedAttribute attr : 
injector.getInjectedAttributes())
 {
-attributeSet.add(attr);
+if (attr.appliesToConfiguredObjectType((Class>) clazz))
+{
+attributeSet.add(attr);
+}
 }
-}
 
-for (ConfiguredObjectInjectedStatistic attr : 
injector.getInjectedStatistics())
-{
-if (attr.appliesToConfiguredObjectType((Class>) clazz))
+for (ConfiguredObjectInjectedStatistic attr : 
injector.getInjectedStatistics())
 {
-statisticSet.add(attr);
+if (attr.appliesToConfiguredObjectType((Class>) clazz))
+{
+statisticSet.add(attr);
+}
 }
-}
 
-for (ConfiguredObjectInjectedOperation operation : 
injector.getInjectedOperations())
-{
-if (operation.appliesToConfiguredObjectType((Class>) clazz))
+for (ConfiguredObjectInjectedOperation operation : 
injector.getInjectedOperations())
 {
-operationsSet.add(operation);
+if (operation.appliesToConfiguredObjectType((Class>) clazz))
+{
+operationsSet.add(operation);
+}
 }
 }
 }
diff --git 
a/broker-core/src/main/java/org/apache/qpid/server/plugin/ConfiguredObjectAttributeInjector.java
 
b/broker-core/src/main/java/org/apache/qpid/server/plugin/ConfiguredObjectAttributeInjector.java
index 779884a..13d9dd9 100644
--- 

[qpid-proton] branch master updated: NO-JIRA Perform Travis compilation in parallel (#206)

2019-11-21 Thread jdanek
This is an automated email from the ASF dual-hosted git repository.

jdanek pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
 new 22a8e50  NO-JIRA Perform Travis compilation in parallel (#206)
22a8e50 is described below

commit 22a8e50a03520491502988da899762d41d788568
Author: Jiří Daněk 
AuthorDate: Thu Nov 21 11:51:02 2019 +0100

NO-JIRA Perform Travis compilation in parallel (#206)
---
 .travis.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.travis.yml b/.travis.yml
index 83cc98d..c6828a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -83,5 +83,5 @@ before_script:
 - cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install ${QPID_PROTON_CMAKE_ARGS}
 
 script:
-- cmake --build . --target install && ctest -V ${QPID_PROTON_CTEST_ARGS}
+- cmake --build . --target install -- -j$(nproc) && ctest -V 
${QPID_PROTON_CTEST_ARGS}
 


-
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org