[qpid-broker-j] branch main updated: QPID-8573: [Broker-J] Logging enhancement of Sole Connection Enforcement Policy events
This is an automated email from the ASF dual-hosted git repository. vavrtom pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git The following commit(s) were added to refs/heads/main by this push: new d7fc06b QPID-8573: [Broker-J] Logging enhancement of Sole Connection Enforcement Policy events d7fc06b is described below commit d7fc06b67ff8e417e228e81932fe9960a304cf3b Author: Marek Laca AuthorDate: Tue Feb 22 13:58:16 2022 +0100 QPID-8573: [Broker-J] Logging enhancement of Sole Connection Enforcement Policy events This closes #114 --- .../logging/messages/ResourceLimitMessages.java| 62 ++ .../messages/ResourceLimit_logmessages.properties | 1 + .../protocol/v1_0/AMQPConnection_1_0Impl.java | 11 .../SoleConnectionEnforcementPolicyException.java | 19 +-- .../StrongConnectionEstablishmentLimiter.java | 2 +- .../protocol/v1_0/ProtocolEngine_1_0_0Test.java| 2 +- .../StrongConnectionEstablishmentLimiterTest.java | 8 +-- 7 files changed, 96 insertions(+), 9 deletions(-) diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimitMessages.java b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimitMessages.java index 743db3e..5d50add 100644 --- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimitMessages.java +++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimitMessages.java @@ -64,12 +64,14 @@ public class ResourceLimitMessages public static final String RESOURCELIMIT_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "resourcelimit"; public static final String ACCEPTED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "resourcelimit.accepted"; +public static final String INFO_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "resourcelimit.info"; public static final String REJECTED_LOG_HIERARCHY = DEFAULT_LOG_HIERARCHY_PREFIX + "resourcelimit.rejected"; static { LoggerFactory.getLogger(RESOURCELIMIT_LOG_HIERARCHY); LoggerFactory.getLogger(ACCEPTED_LOG_HIERARCHY); +LoggerFactory.getLogger(INFO_LOG_HIERARCHY); LoggerFactory.getLogger(REJECTED_LOG_HIERARCHY); _messages = ResourceBundle.getBundle("org.apache.qpid.server.logging.messages.ResourceLimit_logmessages", _currentLocale); @@ -137,6 +139,66 @@ public class ResourceLimitMessages /** * Log a ResourceLimit message of the Format: + * RL-1003 : Info : {0} : {1} + * Optional values are contained in [square brackets] and are numbered + * sequentially in the method call. + * + */ +public static LogMessage INFO(String param1, String param2) +{ +String rawMessage = _messages.getString("INFO"); + +final Object[] messageArguments = {param1, param2}; +// Create a new MessageFormat to ensure thread safety. +// Sharing a MessageFormat and using applyPattern is not thread safe +MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); + +final String message = formatter.format(messageArguments); + +return new LogMessage() +{ +@Override +public String toString() +{ +return message; +} + +@Override +public String getLogHierarchy() +{ +return INFO_LOG_HIERARCHY; +} + +@Override +public boolean equals(final Object o) +{ +if (this == o) +{ +return true; +} +if (o == null || getClass() != o.getClass()) +{ +return false; +} + +final LogMessage that = (LogMessage) o; + +return getLogHierarchy().equals(that.getLogHierarchy()) && toString().equals(that.toString()); + +} + +@Override +public int hashCode() +{ +int result = toString().hashCode(); +result = 31 * result + getLogHierarchy().hashCode(); +return result; +} +}; +} + +/** + * Log a ResourceLimit message of the Format: * RL-1002 : Rejected : {0} {1} by {2} : {3} * Optional values are contained in [square brackets] and are numbered * sequentially in the method call. diff --git a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimit_logmessages.properties b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimit_logmessages.properties index a78feed..87b5f74 100644 --- a/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimit_logmessages.properties +++ b/broker-core/src/main/java/org/apache/qpid/server/logging/messages/ResourceLimit_log
[qpid-dispatch] branch main updated: NO-JIRA: Bump apache.pom (for Rat licenses check) from 24 to 25 (#1527)
This is an automated email from the ASF dual-hosted git repository. jdanek pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git The following commit(s) were added to refs/heads/main by this push: new b114a44 NO-JIRA: Bump apache.pom (for Rat licenses check) from 24 to 25 (#1527) b114a44 is described below commit b114a445b59058a91583d896d379d55a0cc86797 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> AuthorDate: Tue Feb 22 16:51:44 2022 +0100 NO-JIRA: Bump apache.pom (for Rat licenses check) from 24 to 25 (#1527) Bumps [apache](https://github.com/apache/maven-apache-parent) from 24 to 25. - [Release notes](https://github.com/apache/maven-apache-parent/releases) - [Commits](https://github.com/apache/maven-apache-parent/commits) --- updated-dependencies: - dependency-name: org.apache:apache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c5d0ce4..1dcdf02 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ org.apache apache - 24 + 25 4.0.0 - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org
[qpid-dispatch] branch main updated: DISPATCH-2333: fix incorrect assertion check
This is an automated email from the ASF dual-hosted git repository. kgiusti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git The following commit(s) were added to refs/heads/main by this push: new b58ce50 DISPATCH-2333: fix incorrect assertion check b58ce50 is described below commit b58ce50bee634e4dd2155d19ae68ad5184eea0ed Author: Kenneth Giusti AuthorDate: Mon Feb 21 14:27:51 2022 -0500 DISPATCH-2333: fix incorrect assertion check This closes #1528 --- src/policy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/policy.c b/src/policy.c index 5830b35..3d83cba 100644 --- a/src/policy.c +++ b/src/policy.c @@ -288,9 +288,9 @@ bool qd_policy_socket_accept(qd_policy_t *policy, const char *hostname) void qd_policy_socket_close(qd_policy_t *policy, const qd_connection_t *conn) { sys_mutex_lock(stats_lock); +assert (n_connections > 0); n_connections--; uint64_t nc = n_connections; -assert (n_connections >= 0); sys_mutex_unlock(stats_lock); if (policy->enableVhostPolicy) { // HACK ALERT: TODO: This should be deferred to a Python thread - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org
[qpid-dispatch] branch main updated: DISPATCH-2326: Additional fix. Remove the nghttp2 library from CMakeLists.txt and other files
This is an automated email from the ASF dual-hosted git repository. gmurthy pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git The following commit(s) were added to refs/heads/main by this push: new ec62cb2 DISPATCH-2326: Additional fix. Remove the nghttp2 library from CMakeLists.txt and other files ec62cb2 is described below commit ec62cb2e6f1cd1cdf367103a8ad7dc9e21b21cff Author: Ganesh Murthy AuthorDate: Thu Feb 17 14:35:19 2022 -0500 DISPATCH-2326: Additional fix. Remove the nghttp2 library from CMakeLists.txt and other files --- .github/workflows/build.yaml | 12 +- .travis.yml | 32 +--- CMakeLists.txt| 5 - README.adoc | 42 - cmake/Findlibnghttp2.cmake| 47 - dockerfiles/Dockerfile-fedora | 4 +- dockerfiles/Dockerfile-ubuntu | 4 +- tests/CMakeLists.txt | 4 +- tests/TCP_echo_client.py | 320 -- tests/TCP_echo_server.py | 397 -- tests/http2_slow_q2_server.py | 116 tests/tox.ini.in | 23 --- 12 files changed, 8 insertions(+), 998 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2d1a1a2..85e58e8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -109,7 +109,7 @@ jobs: - name: Install Linux build dependencies if: ${{ runner.os == 'Linux' }} run: | - sudo apt update; sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev libwebsockets-dev libnghttp2-dev ccache ninja-build pixz libbenchmark-dev + sudo apt update; sudo apt install -y swig libpython3-dev libsasl2-dev libjsoncpp-dev libwebsockets-dev ccache ninja-build pixz libbenchmark-dev - name: Zero ccache stats run: ccache -z @@ -207,7 +207,7 @@ jobs: architecture: x64 - name: Install Python runtime/test dependencies -run: python -m pip install tox quart selectors h2 grpcio protobuf websockets pytest +run: python -m pip install tox websockets pytest - name: Install Linux runtime/test dependencies if: ${{ runner.os == 'Linux' }} @@ -427,11 +427,7 @@ jobs: run: env -0 | sort -z | tr '\0' '\n' - name: Install Python runtime/test dependencies -run: python3 -m pip install tox quart selectors h2 protobuf websockets pytest - - - name: Install Python runtime/test dependencies (Fedora) -if: ${{ matrix.container == 'fedora' }} -run: python3 -m pip install grpcio +run: python3 -m pip install tox websockets pytest - name: Install Linux runtime/test dependencies if: ${{ runner.os == 'Linux' }} @@ -505,7 +501,7 @@ jobs: - name: Install Linux build dependencies if: ${{ runner.os == 'Linux' }} run: | - sudo apt update; sudo apt install -y libqpid-proton-proactor1-dev python3-qpid-proton libpython3-dev libwebsockets-dev libnghttp2-dev ninja-build + sudo apt update; sudo apt install -y libqpid-proton-proactor1-dev python3-qpid-proton libpython3-dev libwebsockets-dev ninja-build - name: Install Linux docs dependencies if: ${{ runner.os == 'Linux' }} diff --git a/.travis.yml b/.travis.yml index 08947b9..f204e61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,16 +79,9 @@ jobs: - sudo apt-get install -y python3-pip - python3 -m pip install --user --upgrade pip - python3 -m pip install --user tox virtualenv -# Install quart, h2 to run the http2 tests. -- python3 -m pip install --user quart h2 -# DISPATCH-1883: Install selectors to run tcp echo server/client tools -- python3 -m pip install --user selectors -# Install grpcio and protobuf to run the grpc tests. -- python3 -m pip install --user grpcio protobuf env: - QPID_SYSTEM_TEST_TIMEOUT=300 - QPID_SYSTEM_TEST_SKIP_FALLBACK_SWITCHOVER_TEST=True -- QPID_SYSTEM_TEST_SKIP_HTTP2_LARGE_IMAGE_UPLOAD_TEST=True - CC=clang-13 - CXX=clang++-13 - PATH="/usr/bin:$PATH" PROTON_VERSION=0.36.0 BUILD_TYPE=RelWithDebInfo @@ -103,15 +96,7 @@ jobs: # Update pip, it may prevent issues later - python3 -m pip install --user --upgrade pip - python3 -m pip install --user tox virtualenv - # Install quart to run the http2 tests. - - python3 -m pip install --user quart - # DISPATCH-1883: Install selectors to run tcp echo server/client tools - - python3 -m pip install --user selectors - # Install grpcio and protobuf to run the grpc tests. - # Installation on s390x currently broken https://github.com/grpc/grpc/pull/25363 # Binary wheel is not available in PyPI for s390x and source install requires fetching git submodules first - - python3 -m pip install --user protobuf - - sudo apt install python3-grpcio env
[qpid-dispatch] branch main updated: DISPATCH-2276: Accomodate hex values in 0.36+ qpid-proton logging (#1525)
This is an automated email from the ASF dual-hosted git repository. chug pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git The following commit(s) were added to refs/heads/main by this push: new 6f75d1f DISPATCH-2276: Accomodate hex values in 0.36+ qpid-proton logging (#1525) 6f75d1f is described below commit 6f75d1f3dc1600204289e54ed395a22e5e486f26 Author: Chuck Rolke AuthorDate: Tue Feb 22 12:09:59 2022 -0500 DISPATCH-2276: Accomodate hex values in 0.36+ qpid-proton logging (#1525) * DISPATCH-2276: Accomodate hex values in 0.36+ qpid-proton logging * Fix code that extracts integer values during AMQP analysis * Convert ints from hex to decimal for web display of values line link and session numbers and credit. * DISPATCH-2276: Topology disposition test does not need to import proton Co-authored-by: chug Co-authored-by: Chuck Rolke --- tests/system_tests_topology_disposition.py | 2 -- tools/scraper/amqp_detail.py | 8 tools/scraper/parser.py| 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/system_tests_topology_disposition.py b/tests/system_tests_topology_disposition.py index 25e8046..22b684c 100644 --- a/tests/system_tests_topology_disposition.py +++ b/tests/system_tests_topology_disposition.py @@ -23,7 +23,6 @@ import time import unittest from subprocess import PIPE, STDOUT -import proton from proton import Message from proton.handlers import MessagingHandler from proton.reactor import Container @@ -406,7 +405,6 @@ class TopologyDispositionTests (TestCase): self.assertIsNone(error) self.assertIsNone(error) -@unittest.skipIf(proton.VERSION > (0, 36, 0), "see DISPATCH-2276") def test_04_scraper_tool(self): name = 'test_04' error = str(None) diff --git a/tools/scraper/amqp_detail.py b/tools/scraper/amqp_detail.py index 0b2c3cd..b1c8147 100755 --- a/tools/scraper/amqp_detail.py +++ b/tools/scraper/amqp_detail.py @@ -681,7 +681,7 @@ class AllDetails(): sdispmap = sess.rx_rcvr_disposition_map if splf.data.is_receiver else sess.rx_sndr_disposition_map else: sdispmap = sess.tx_rcvr_disposition_map if splf.data.is_receiver else sess.tx_sndr_disposition_map -for sdid in range(int(splf.data.first), (int(splf.data.last) + 1)): +for sdid in range(int(splf.data.first, 0), (int(splf.data.last, 0) + 1)): did = str(sdid) if did in sdispmap: old_splf = sdispmap[did] @@ -829,7 +829,7 @@ class AllDetails(): tod_of_second_attach = plf.datetime if look_for_sender_delivery_id: if plf.data.name == "attach" and not plf.data.is_receiver: -current_delivery = int(plf.data.described_type.dict.get("initial-delivery_count", "0")) +current_delivery = int(plf.data.described_type.dict.get("initial-delivery_count", "0"), 0) delivery_limit = current_delivery look_for_sender_delivery_id = False @@ -838,7 +838,7 @@ class AllDetails(): # a flow in the normal direction updates the delivery limit dc = plf.data.described_type.dict.get("delivery-count", "0") lc = plf.data.described_type.dict.get("link-credit", "0") -delivery_limit = int(dc) + int(lc) # TODO: wrap at 32-bits +delivery_limit = int(dc, 0) + int(lc, 0) # TODO: wrap at 32-bits if n_attaches < 2: # a working flow before sender attach - cancel initial stall init_stall = False @@ -858,7 +858,7 @@ class AllDetails(): else: # flow in the opposite direction updates the senders current delivery # normally used to consume credit in response to a drain from receiver -current_delivery = int(plf.data.described_type.dict.get("initial-delivery_count", "0")) +current_delivery = int(plf.data.described_type.dict.get("initial-delivery_count", "0"), 0) elif plf.data.transfer: if plf.data.direction == dir_of_xfer: diff --git a/tools/scraper/parser.py b/tools/scraper/parser.py index 4e1f4cd..e5217bf 100755 --- a/tools/scraper/parser.py +++ b/tools/scraper/parser.py @@ -296,6 +296,9 @@ class DescribedType: if
[qpid-proton] branch PROTON-2060 updated: Updated docs according to discussion on PR#354
This is an automated email from the ASF dual-hosted git repository. kpvdr pushed a commit to branch PROTON-2060 in repository https://gitbox.apache.org/repos/asf/qpid-proton.git The following commit(s) were added to refs/heads/PROTON-2060 by this push: new 3acb26b Updated docs according to discussion on PR#354 3acb26b is described below commit 3acb26bbcc7a7d595cf1222ad0bb64122c7b4301 Author: Kim van der Riet AuthorDate: Tue Feb 22 17:18:44 2022 -0500 Updated docs according to discussion on PR#354 --- c/include/proton/delivery.h | 6 -- cpp/include/proton/sender_options.hpp | 10 ++ python/proton/_handlers.py| 33 - ruby/lib/core/sender.rb | 11 +++ 4 files changed, 13 insertions(+), 47 deletions(-) diff --git a/c/include/proton/delivery.h b/c/include/proton/delivery.h index 47e8203..118fbf6 100644 --- a/c/include/proton/delivery.h +++ b/c/include/proton/delivery.h @@ -287,12 +287,6 @@ PN_EXTERN void pn_delivery_abort(pn_delivery_t *delivery); * @note If pn_delivery_current(delivery) is true before the call then * pn_link_advance(pn_delivery_link(deliver)) is called automatically. * - * @note The sender **should not** settle after only receiving a terminal - * status disposition with no settle flag, as then there would then be no way - * to receive any further events for that delivery (such as the subsequent - * on_settle message that might be expected when the receiver finally settles - * the message). - * * @param[in] delivery a delivery object */ PN_EXTERN void pn_delivery_settle(pn_delivery_t *delivery); diff --git a/cpp/include/proton/sender_options.hpp b/cpp/include/proton/sender_options.hpp index acb3f1e..5b5222d 100644 --- a/cpp/include/proton/sender_options.hpp +++ b/cpp/include/proton/sender_options.hpp @@ -83,14 +83,8 @@ class sender_options { PN_CPP_EXTERN sender_options& delivery_mode(delivery_mode); /** - * Automatically settle messages (default is true). - * - * \note - * Sender **auto-settlement** only occurs for a delivery after the - * sender receives a settled disposition for that delivery. Otherwise, - * there would be no way to receive any further events for that delivery - * (such as the subsequent on_settle message that might be expected when - * the receiver finally settles the message). + * If ``True`` (default), automatically settle messages upon receiving a settled + * disposition for that delivery. Otherwise messages must be explicitly settled. */ PN_CPP_EXTERN sender_options& auto_settle(bool); diff --git a/python/proton/_handlers.py b/python/proton/_handlers.py index cb9ffcb..ac783d0 100644 --- a/python/proton/_handlers.py +++ b/python/proton/_handlers.py @@ -48,12 +48,9 @@ class OutgoingMessageHandler(Handler): A utility for simpler and more intuitive handling of delivery events related to outgoing i.e. sent messages. -:param auto_settle: If ``True``, settle all messages (default). Otherwise +:param auto_settle: If ``True`` (default), automatically settle messages +upon receiving a settled disposition for that delivery. Otherwise messages must be explicitly settled. - -.. note:: Sender auto-settlement only occurs for a delivery after the -sender receives a settled disposition for that delivery. - :type auto_settle: ``bool`` :param delegate: A client handler for the endpoint event """ @@ -667,19 +664,12 @@ class MessagingHandler(Handler, Acking): simpler to deal with and/or avoids repetitive tasks for common use cases. -.. note:: Sender **auto-settlement** only occurs for a delivery after the -sender receives a settled disposition for that delivery. Otherwise, -there would be no way to receive any further events for that delivery -(such as the subsequent on_settle message that might be expected when -the receiver finally settles the message). - :param prefetch: Initial flow credit for receiving messages, defaults to 10. :param auto_accept: If ``True``, accept all messages (default). Otherwise messages must be individually accepted or rejected. -:param auto_settle: If ``True``, settle all messages (default). Otherwise -messages must be explicitly settled. Sender auto-settlement only occurs -for a delivery after the sender receives a settled disposition for that -delivery. +:param auto_settle: If ``True`` (default), automatically settle messages +upon receiving a settled disposition for that delivery. Otherwise +messages must be explicitly settled. :param peer_close_is_error: If ``True``, a peer endpoint closing will be treated as an error with an error callback. Otherwise (default), the normal callbacks for the closing will occur. @@ -962,19 +952,12 @@ class TransactionalClientHandler(Mess
[qpid-proton] branch main updated: PROTON-2503: Stop ignoring some received framing errors
This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git The following commit(s) were added to refs/heads/main by this push: new 9976249 PROTON-2503: Stop ignoring some received framing errors 9976249 is described below commit 9976249e8b17b5003529a04deae66c3c8345f8da Author: Andrew Stitcher AuthorDate: Tue Feb 22 18:02:01 2022 -0500 PROTON-2503: Stop ignoring some received framing errors This bug was discovered by the OSS fuzz project --- c/src/core/consumers.h | 6 +-- c/src/proactor/epoll-internal.h| 2 +- c/src/proactor/epoll.c | 52 - c/src/sasl/sasl.c | 4 +- .../crash/leak-5052013914750976| Bin 0 -> 114 bytes python/setup.py.in | 3 -- 6 files changed, 36 insertions(+), 31 deletions(-) diff --git a/c/src/core/consumers.h b/c/src/core/consumers.h index b4140e8..2f20cba 100644 --- a/c/src/core/consumers.h +++ b/c/src/core/consumers.h @@ -539,13 +539,13 @@ static inline bool consume_descriptor(pni_consumer_t* consumer, pni_consumer_t * if (!pni_consumer_readf8(consumer, &type)) return false; switch (type) { case PNE_DESCRIPTOR: { - bool lq = consume_ulong(consumer, descriptor); + if (!consume_ulong(consumer, descriptor)) return false; size_t sposition = consumer->position; uint8_t type; - consume_single_value_not_described(consumer, &type); + if (!consume_single_value_not_described(consumer, &type)) return false; size_t scsize = consumer->position > sposition ? consumer->position-sposition : 0; *subconsumer = (pni_consumer_t){.output_start=consumer->output_start+sposition, .position=0, .size=scsize}; - return lq; + return true; } default: pni_consumer_skip_value_not_described(consumer, type); diff --git a/c/src/proactor/epoll-internal.h b/c/src/proactor/epoll-internal.h index 79dddaa..8db12a1 100644 --- a/c/src/proactor/epoll-internal.h +++ b/c/src/proactor/epoll-internal.h @@ -192,7 +192,7 @@ struct pn_proactor_t { tslot_t *last_earmark; task_t *sched_ready_first; task_t *sched_ready_last; - bool sched_ready_pending; + task_t *sched_ready_current; // TODO: remove or use for sceduling priority or fairness unsigned int sched_ready_count; task_t *resched_first; task_t *resched_last; diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c index 1ff68ef..19867af 100644 --- a/c/src/proactor/epoll.c +++ b/c/src/proactor/epoll.c @@ -250,8 +250,8 @@ void task_init(task_t *tsk, task_type_t t, pn_proactor_t *p) { * are needed to cross or reconcile the two portions of the list. */ -// Call with sched lock held and sched_ready_count > 0. -static task_t *sched_ready_pop_front(pn_proactor_t *p) { +// Call with sched lock held. +static void pop_ready_task(task_t *tsk) { // every task on the sched_ready_list is either currently running, // or to be scheduled. schedule() will not "see" any of the ready_next // pointers until ready and working have transitioned to 0 @@ -262,19 +262,22 @@ static task_t *sched_ready_pop_front(pn_proactor_t *p) { // !ready .. schedule() .. on ready_list .. on sched_ready_list .. working task .. !sched_ready && !ready // // Intervening locks at each transition ensures ready_next has memory coherence throughout the ready task scheduling cycle. + // TODO: sched_ready list changed to sequential processing. Review need for sched_ready_current. + pn_proactor_t *p = tsk->proactor; + if (tsk == p->sched_ready_current) +p->sched_ready_current = tsk->ready_next; + assert (tsk == p->sched_ready_first); assert (p->sched_ready_count); - task_t *tsk = p->sched_ready_first; p->sched_ready_count--; if (tsk == p->sched_ready_last) { p->sched_ready_first = p->sched_ready_last = NULL; } else { p->sched_ready_first = tsk->ready_next; } - if (p->sched_ready_count == 0) { -assert(!p->sched_ready_first); -p->sched_ready_pending = false; + if (!p->sched_ready_first) { +p->sched_ready_last = NULL; +assert(p->sched_ready_count == 0); } - return tsk; } // Call only as the poller task that has already called schedule_ready_list() and already @@ -2262,20 +2265,21 @@ static pn_event_batch_t *process(task_t *tsk) { // Call with both sched_mutex and eventfd_mutex held static void schedule_ready_list(pn_proactor_t *p) { - // Append ready_list_first..ready_list_last to end of sched_ready_last - // May see several in single do_epoll() if EINTR. + // append ready_list_first..ready_list_last to end of sched_ready_last if (p->ready_list_first) { if (p->sched_ready_last) p->sched_ready_last->ready_next = p->ready_list_first; // join them if (!p->sched_ready_first)
[qpid-proton] branch main updated: Revert "PROTON-2503: Stop ignoring some received framing errors"
This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git The following commit(s) were added to refs/heads/main by this push: new 7e76fec Revert "PROTON-2503: Stop ignoring some received framing errors" 7e76fec is described below commit 7e76fec1e57b32fc2992ea4111501bad952dc044 Author: Andrew Stitcher AuthorDate: Tue Feb 22 22:07:03 2022 -0500 Revert "PROTON-2503: Stop ignoring some received framing errors" This reverts commit 9976249e8b17b5003529a04deae66c3c8345f8da. The checkin was messed up --- c/src/core/consumers.h | 6 +-- c/src/proactor/epoll-internal.h| 2 +- c/src/proactor/epoll.c | 52 + c/src/sasl/sasl.c | 4 +- .../crash/leak-5052013914750976| Bin 114 -> 0 bytes python/setup.py.in | 3 ++ 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/c/src/core/consumers.h b/c/src/core/consumers.h index 2f20cba..b4140e8 100644 --- a/c/src/core/consumers.h +++ b/c/src/core/consumers.h @@ -539,13 +539,13 @@ static inline bool consume_descriptor(pni_consumer_t* consumer, pni_consumer_t * if (!pni_consumer_readf8(consumer, &type)) return false; switch (type) { case PNE_DESCRIPTOR: { - if (!consume_ulong(consumer, descriptor)) return false; + bool lq = consume_ulong(consumer, descriptor); size_t sposition = consumer->position; uint8_t type; - if (!consume_single_value_not_described(consumer, &type)) return false; + consume_single_value_not_described(consumer, &type); size_t scsize = consumer->position > sposition ? consumer->position-sposition : 0; *subconsumer = (pni_consumer_t){.output_start=consumer->output_start+sposition, .position=0, .size=scsize}; - return true; + return lq; } default: pni_consumer_skip_value_not_described(consumer, type); diff --git a/c/src/proactor/epoll-internal.h b/c/src/proactor/epoll-internal.h index 8db12a1..79dddaa 100644 --- a/c/src/proactor/epoll-internal.h +++ b/c/src/proactor/epoll-internal.h @@ -192,7 +192,7 @@ struct pn_proactor_t { tslot_t *last_earmark; task_t *sched_ready_first; task_t *sched_ready_last; - task_t *sched_ready_current; // TODO: remove or use for sceduling priority or fairness + bool sched_ready_pending; unsigned int sched_ready_count; task_t *resched_first; task_t *resched_last; diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c index 19867af..1ff68ef 100644 --- a/c/src/proactor/epoll.c +++ b/c/src/proactor/epoll.c @@ -250,8 +250,8 @@ void task_init(task_t *tsk, task_type_t t, pn_proactor_t *p) { * are needed to cross or reconcile the two portions of the list. */ -// Call with sched lock held. -static void pop_ready_task(task_t *tsk) { +// Call with sched lock held and sched_ready_count > 0. +static task_t *sched_ready_pop_front(pn_proactor_t *p) { // every task on the sched_ready_list is either currently running, // or to be scheduled. schedule() will not "see" any of the ready_next // pointers until ready and working have transitioned to 0 @@ -262,22 +262,19 @@ static void pop_ready_task(task_t *tsk) { // !ready .. schedule() .. on ready_list .. on sched_ready_list .. working task .. !sched_ready && !ready // // Intervening locks at each transition ensures ready_next has memory coherence throughout the ready task scheduling cycle. - // TODO: sched_ready list changed to sequential processing. Review need for sched_ready_current. - pn_proactor_t *p = tsk->proactor; - if (tsk == p->sched_ready_current) -p->sched_ready_current = tsk->ready_next; - assert (tsk == p->sched_ready_first); assert (p->sched_ready_count); + task_t *tsk = p->sched_ready_first; p->sched_ready_count--; if (tsk == p->sched_ready_last) { p->sched_ready_first = p->sched_ready_last = NULL; } else { p->sched_ready_first = tsk->ready_next; } - if (!p->sched_ready_first) { -p->sched_ready_last = NULL; -assert(p->sched_ready_count == 0); + if (p->sched_ready_count == 0) { +assert(!p->sched_ready_first); +p->sched_ready_pending = false; } + return tsk; } // Call only as the poller task that has already called schedule_ready_list() and already @@ -2265,21 +2262,20 @@ static pn_event_batch_t *process(task_t *tsk) { // Call with both sched_mutex and eventfd_mutex held static void schedule_ready_list(pn_proactor_t *p) { - // append ready_list_first..ready_list_last to end of sched_ready_last + // Append ready_list_first..ready_list_last to end of sched_ready_last + // May see several in single do_epoll() if EINTR. if (p->ready_list_first) { if (p->sched_ready_last) p->sched_ready_last->ready_next = p->ready_list_firs
[qpid-proton] branch main updated: PROTON-2503: Stop ignoring received framing errors discovered by fuzzer
This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git The following commit(s) were added to refs/heads/main by this push: new e2137ca PROTON-2503: Stop ignoring received framing errors discovered by fuzzer e2137ca is described below commit e2137cab7bd891666e390a65e7e89a77f3029ff1 Author: Andrew Stitcher AuthorDate: Tue Feb 22 18:02:01 2022 -0500 PROTON-2503: Stop ignoring received framing errors discovered by fuzzer --- c/src/core/consumers.h| 6 +++--- c/src/sasl/sasl.c | 4 ++-- .../fuzz-connection-driver/crash/leak-5052013914750976| Bin 0 -> 114 bytes 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/c/src/core/consumers.h b/c/src/core/consumers.h index b4140e8..2f20cba 100644 --- a/c/src/core/consumers.h +++ b/c/src/core/consumers.h @@ -539,13 +539,13 @@ static inline bool consume_descriptor(pni_consumer_t* consumer, pni_consumer_t * if (!pni_consumer_readf8(consumer, &type)) return false; switch (type) { case PNE_DESCRIPTOR: { - bool lq = consume_ulong(consumer, descriptor); + if (!consume_ulong(consumer, descriptor)) return false; size_t sposition = consumer->position; uint8_t type; - consume_single_value_not_described(consumer, &type); + if (!consume_single_value_not_described(consumer, &type)) return false; size_t scsize = consumer->position > sposition ? consumer->position-sposition : 0; *subconsumer = (pni_consumer_t){.output_start=consumer->output_start+sposition, .position=0, .size=scsize}; - return lq; + return true; } default: pni_consumer_skip_value_not_described(consumer, type); diff --git a/c/src/sasl/sasl.c b/c/src/sasl/sasl.c index 09a3496..1fc16a9 100644 --- a/c/src/sasl/sasl.c +++ b/c/src/sasl/sasl.c @@ -946,7 +946,7 @@ int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t cha switch (element_type) { case PNE_SYM8: while (element_count) { - pni_consumer_readv8(&subconsumer, &symbol); + if (!pni_consumer_readv8(&subconsumer, &symbol)) break; if (pni_sasl_client_included_mech(sasl->included_mechanisms, symbol)) { pn_string_addf(mechs, "%.*s ", (int)symbol.size, symbol.start); } @@ -955,7 +955,7 @@ int pn_do_mechanisms(pn_transport_t *transport, uint8_t frame_type, uint16_t cha break; case PNE_SYM32: while (element_count) { - pni_consumer_readv32(&subconsumer, &symbol); + if (!pni_consumer_readv32(&subconsumer, &symbol)) break; if (pni_sasl_client_included_mech(sasl->included_mechanisms, symbol)) { pn_string_addf(mechs, "%.*s ", (int)symbol.size, symbol.start); } diff --git a/c/tests/fuzz/fuzz-connection-driver/crash/leak-5052013914750976 b/c/tests/fuzz/fuzz-connection-driver/crash/leak-5052013914750976 new file mode 100644 index 000..1c9e3df Binary files /dev/null and b/c/tests/fuzz/fuzz-connection-driver/crash/leak-5052013914750976 differ - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org
[qpid-broker-j] branch main updated: QPID-8487: [Broker-J] Enhance ACL rule evaluation
This is an automated email from the ASF dual-hosted git repository. vavrtom pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git The following commit(s) were added to refs/heads/main by this push: new 75b1fc6 QPID-8487: [Broker-J] Enhance ACL rule evaluation 75b1fc6 is described below commit 75b1fc6e053ef0061ab6514d90b503d87bc7aa63 Author: Marek Laca AuthorDate: Wed Feb 23 07:58:14 2022 +0100 QPID-8487: [Broker-J] Enhance ACL rule evaluation This closes #115 --- .../security/access/config/LegacyOperation.java| 13 +- .../server/security/access/config/ObjectType.java | 43 +- .../qpid/server/security/access/config/Rule.java | 29 +- .../security/access/config/RuleCollector.java | 2 +- .../security/access/config/RuleInspector.java | 64 ++ .../security/access/config/RulePredicate.java | 11 + .../server/security/access/config/RuleSet.java | 279 +--- .../security/access/config/RuleSetBuilder.java | 204 ++ .../server/security/access/config/RuleSetImpl.java | 419 +++ ...stractCommonRuleBasedAccessControlProvider.java | 4 +- .../security/access/plugins/RuleOutcome.java | 61 +- .../security/access/config/AclFileParserTest.java | 68 +- .../access/config/AclRulePredicatesTest.java | 4 - .../access/config/LegacyOperationTest.java | 43 ++ .../security/access/config/ObjectTypeTest.java | 65 ++ .../security/access/config/RuleCollectorTest.java | 14 +- .../server/security/access/config/RuleSetTest.java | 767 - .../server/security/access/config/RuleTest.java| 62 +- .../config/predicates/RulePredicateTest.java | 15 + .../security/access/plugins/RuleOutcomeTest.java | 62 ++ .../jms_1_1/extensions/acl/MessagingACLTest.java | 7 +- 21 files changed, 1866 insertions(+), 370 deletions(-) diff --git a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyOperation.java b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyOperation.java index 56ca67c..2270864 100644 --- a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyOperation.java +++ b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/LegacyOperation.java @@ -18,6 +18,8 @@ */ package org.apache.qpid.server.security.access.config; +import java.util.Locale; + /** * An enumeration of all possible actions that can form part of an access control v2 rule. */ @@ -38,10 +40,17 @@ public enum LegacyOperation SHUTDOWN, INVOKE; +private final String _description; + +LegacyOperation() +{ +final String name = name(); +_description = name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1).toLowerCase(Locale.ENGLISH); +} + @Override public String toString() { -String name = name(); -return name.charAt(0) + name.substring(1).toLowerCase(); +return _description; } } diff --git a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/ObjectType.java b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/ObjectType.java index b2b4246..860ab5e 100644 --- a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/ObjectType.java +++ b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/ObjectType.java @@ -18,6 +18,11 @@ */ package org.apache.qpid.server.security.access.config; +import java.util.Collections; +import java.util.EnumSet; +import java.util.Locale; +import java.util.Set; + import static org.apache.qpid.server.security.access.config.LegacyOperation.ACCESS; import static org.apache.qpid.server.security.access.config.LegacyOperation.ACCESS_LOGS; import static org.apache.qpid.server.security.access.config.LegacyOperation.BIND; @@ -32,18 +37,15 @@ import static org.apache.qpid.server.security.access.config.LegacyOperation.SHUT import static org.apache.qpid.server.security.access.config.LegacyOperation.UNBIND; import static org.apache.qpid.server.security.access.config.LegacyOperation.UPDATE; -import java.util.EnumSet; -import java.util.Set; - /** * An enumeration of all possible object types that can form part of an access control v2 rule. - * + * * Each object type is valid only for a certain set of {@link LegacyOperation}s, which are passed as a list to * the constructor, and can be checked using the {@link #isSupported(LegacyOperation)} method. */ public enum ObjectType { -ALL(EnumSet.allOf(LegacyOperation.class)), +ALL, VIRTUALHOSTNODE(LegacyOperation.ALL, CREATE, DELETE, UPDATE, INVOKE), VIRTUALHOST(LegacyOperation.ALL, ACCESS, CREATE, DELETE, UPDATE, ACCESS_LOGS, INVOKE), MANAGEMENT
[qpid-broker-j] branch main updated: QPID-8488: [Broker-J] Enhance ACL rule with multi-value properties
This is an automated email from the ASF dual-hosted git repository. vavrtom pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-broker-j.git The following commit(s) were added to refs/heads/main by this push: new 0b91ded QPID-8488: [Broker-J] Enhance ACL rule with multi-value properties 0b91ded is described below commit 0b91ded6e2c4587ff4ce2324636e2e5f22645295 Author: Marek Laca AuthorDate: Wed Feb 23 07:58:41 2022 +0100 QPID-8488: [Broker-J] Enhance ACL rule with multi-value properties This closes #116 --- .../security/access/config/AclFileParser.java | 46 +- .../security/access/config/AclRulePredicates.java | 34 +- .../access/config/AclRulePredicatesBuilder.java| 112 ++- .../qpid/server/security/access/config/Rule.java | 11 +- .../access/config/predicates/MultiValue.java | 54 ++ .../config/predicates/RulePredicateBuilder.java| 9 +- ...stractCommonRuleBasedAccessControlProvider.java | 26 +- .../server/security/access/plugins/AclRule.java| 6 +- .../security/access/util/AbstractTreeBranch.java | 98 +++ .../qpid/server/security/access/util/Any.java | 59 ++ .../qpid/server/security/access/util/Empty.java| 57 ++ .../server/security/access/util/FinalBranch.java | 70 ++ .../server/security/access/util/PrefixTree.java| 111 +++ .../server/security/access/util/PrefixTreeSet.java | 33 + .../server/security/access/util/TreeBranch.java| 236 ++ .../qpid/server/security/access/util/TreeRoot.java | 76 ++ .../security/access/util/WildCardBranch.java | 102 +++ .../server/security/access/util/WildCardSet.java | 48 ++ .../access/config/AclRulePredicatesTest.java | 43 +- .../predicates/RulePredicateBuilderTest.java | 67 ++ .../config/predicates/RulePredicateTest.java | 57 ++ .../security/access/util/PrefixTreeTest.java | 942 + .../management/accesscontrolprovider/RuleBased.js | 18 +- ...Java-Broker-Security-AccessControlProviders.xml | 17 +- 24 files changed, 2251 insertions(+), 81 deletions(-) diff --git a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclFileParser.java b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclFileParser.java index a964af7..bb1c54c 100644 --- a/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclFileParser.java +++ b/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/config/AclFileParser.java @@ -32,26 +32,30 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayDeque; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.Locale; import java.util.Map; import java.util.Optional; import java.util.Queue; +import java.util.Set; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import org.apache.qpid.server.configuration.IllegalConfigurationException; import org.apache.qpid.server.logging.EventLoggerProvider; import org.apache.qpid.server.security.Result; import org.apache.qpid.server.security.access.config.Rule.Builder; import org.apache.qpid.server.security.access.plugins.RuleOutcome; +import com.google.common.collect.Iterables; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public final class AclFileParser { private static final Logger LOGGER = LoggerFactory.getLogger(AclFileParser.class); @@ -81,6 +85,8 @@ public final class AclFileParser static final String PROPERTY_NO_VALUE_MSG = "Incomplete property (no value) at line %d"; static final String GROUP_NOT_SUPPORTED = "GROUP keyword not supported at line %d." + " Groups should defined via a Group Provider, not in the ACL file."; +static final String PROPERTY_NO_CLOSE_BRACKET_MSG = "Incomplete property (no close bracket) at line %d"; + private static final String INVALID_ENUM = "Not a valid %s: %s"; private static final String INVALID_URL = "Cannot convert %s to a readable resource"; @@ -322,7 +328,8 @@ public final class AclFileParser while (i.hasNext()) { final String key = i.next().toLowerCase(Locale.ENGLISH); -final Boolean value = Boolean.valueOf(readValue(i, line)); +final Set values = readValue(i, line); +final Boolean value = Boolean.valueOf(Iterables.getOnlyElement(values)); if (Boolean.TRUE.equals(value)) { @@ -343,7 +350,7 @@ public final class AclFileParser } } -private static String readValue(Iterator tokenIterator, int line) +private static Set readValue(Iterator tokenIterator, int line) {