[qpid-protonj2] branch main updated: PROTON-2702 Allow the server to accept a new connection
This is an automated email from the ASF dual-hosted git repository. tabish pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git The following commit(s) were added to refs/heads/main by this push: new f5cdc0d3 PROTON-2702 Allow the server to accept a new connection f5cdc0d3 is described below commit f5cdc0d3329d47bd38d5436bedcc73f0d1f8dfaf Author: Timothy Bish AuthorDate: Thu Mar 30 18:48:42 2023 -0400 PROTON-2702 Allow the server to accept a new connection If the active connection drops or is disconnected allow the server to be scripted to accept a new client connection. --- .../qpid/protonj2/client/impl/ReconnectTest.java | 4 +- .../qpid/protonj2/test/driver/AMQPTestDriver.java | 15 ++- .../protonj2/test/driver/ProtonTestClient.java | 19 ++- .../protonj2/test/driver/ProtonTestConnector.java | 12 +- .../qpid/protonj2/test/driver/ProtonTestPeer.java | 96 +-- .../protonj2/test/driver/ProtonTestServer.java | 58 - .../test/driver/actions/ConnectionDropAction.java | 4 +- ...tionDropAction.java => PeerShutdownAction.java} | 12 +- .../protonj2/test/driver/netty/NettyIOBuilder.java | 8 +- .../protonj2/test/driver/netty/NettyServer.java| 130 ++--- .../test/driver/netty/netty4/Netty4Server.java | 37 +- .../test/driver/netty/netty5/Netty5Server.java | 31 - .../protonj2/test/driver/ProtonTestClientTest.java | 31 + 13 files changed, 406 insertions(+), 51 deletions(-) diff --git a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java index 84adf200..28cf7789 100644 --- a/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java +++ b/protonj2-client/src/test/java/org/apache/qpid/protonj2/client/impl/ReconnectTest.java @@ -57,7 +57,7 @@ public class ReconnectTest extends ImperativeClientTestCase { firstPeer.expectSASLAnonymousConnect(); firstPeer.expectOpen().withContainerId(any(String.class)).respond(); -firstPeer.dropAfterLastHandler(5); +firstPeer.shutdownAfterLastHandler(5); firstPeer.start(); finalPeer.expectSASLAnonymousConnect(); @@ -101,7 +101,7 @@ public class ReconnectTest extends ImperativeClientTestCase { finalPeer.waitForScriptToComplete(); finalPeer.expectBegin().respond(); finalPeer.expectEnd().respond(); -finalPeer.dropAfterLastHandler(10); +finalPeer.shutdownAfterLastHandler(10); Session session = connection.openSession().openFuture().get(); diff --git a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/AMQPTestDriver.java b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/AMQPTestDriver.java index a277de7a..9403e01d 100644 --- a/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/AMQPTestDriver.java +++ b/protonj2-test-driver/src/main/java/org/apache/qpid/protonj2/test/driver/AMQPTestDriver.java @@ -253,6 +253,15 @@ public class AMQPTestDriver implements Consumer { } } +void handleConnectedDropped() throws AssertionError { +synchronized (script) { +// For now we just reset the parse as any new connection would need to +// send an AMQP header, other validation could be added if we expand +// processing on client disconnect events. +frameParser.resetToExpectingHeader(); +} +} + void handleHeader(AMQPHeader header) throws AssertionError { synchronized (script) { final ScriptedElement scriptEntry = script.poll(); @@ -590,7 +599,7 @@ public class AMQPTestDriver implements Consumer { final ByteBuffer output; final ByteBuffer buffer = frameEncoder.handleWrite(performative, channel, payload, null); -if (deferredWrites != null) { +if (!deferredWrites.isEmpty()) { deferredWrites.add(buffer); try { output = composeDefferedWrites(deferredWrites).asReadOnlyBuffer(); @@ -644,7 +653,7 @@ public class AMQPTestDriver implements Consumer { try { final ByteBuffer buffer = frameEncoder.handleWrite(performative, channel); -if (deferredWrites != null) { +if (!deferredWrites.isEmpty()) { deferredWrites.add(buffer); try { output = composeDefferedWrites(deferredWrites).asReadOnlyBuffer(); @@ -674,7 +683,7 @@ public class AMQPTestDriver implements Consumer { try { final ByteBuffer output; -if (deferredWrites != null) { +if (!deferredWrites.isEmpty()) { LOG.trace("{} appending deferred buffer {} to next write.",
[qpid-proton] branch main updated: PROTON-2701: Make python binding build respect BUILD_TESTING
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 fcb70af63 PROTON-2701: Make python binding build respect BUILD_TESTING fcb70af63 is described below commit fcb70af63a3396810b0c84ff7b94767fdd83ecf9 Author: Andrew Stitcher AuthorDate: Thu Mar 30 14:28:43 2023 -0400 PROTON-2701: Make python binding build respect BUILD_TESTING --- python/CMakeLists.txt | 135 ++ 1 file changed, 69 insertions(+), 66 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 69b2a56f6..2f6da5ad5 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -138,6 +138,8 @@ foreach(file IN LISTS py_dist_files pysrc) list(APPEND pysrc_files "${CMAKE_CURRENT_BINARY_DIR}/${file}") endforeach() +add_custom_target(pysrc_copied ALL DEPENDS .timestamp.copied_pysrc ${pysrc_files}) + add_custom_command(OUTPUT ./tox.ini COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/tox.ini" tox.ini DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/tox.ini") @@ -154,83 +156,84 @@ endif() if (pydist_cmds) add_custom_command(OUTPUT .timestamp.dist -DEPENDS .timestamp.cproton_ffi +DEPENDS pysrc_copied COMMAND ${CMAKE_COMMAND} -E remove -f .timestamp.dist COMMAND ${Python_EXECUTABLE} setup.py ${pydist_cmds} COMMAND ${CMAKE_COMMAND} -E touch .timestamp.dist) - add_custom_target(pydist DEPENDS .timestamp.dist) - add_custom_target(pytest_cffi ALL DEPENDS pydist) -else() - add_custom_target(pytest_cffi ALL DEPENDS .timestamp.cproton_ffi) + add_custom_target(pydist ALL DEPENDS .timestamp.dist) endif () -# python test: python/tests/proton-test -set (py_src "${CMAKE_CURRENT_SOURCE_DIR}") -set (py_bin "${CMAKE_CURRENT_BINARY_DIR}") -# These are only needed on Windows due to build differences -set (py_bld "$<$:$>") -set (py_tests "${py_src}/tests") -set (tests_py "${py_src}/../tests/py") +if (BUILD_TESTING) + add_custom_target(pytest_cffi ALL DEPENDS .timestamp.cproton_ffi) + + # python test: python/tests/proton-test + set (py_src "${CMAKE_CURRENT_SOURCE_DIR}") + set (py_bin "${CMAKE_CURRENT_BINARY_DIR}") + # These are only needed on Windows due to build differences + set (py_bld "$<$:$>") + set (py_tests "${py_src}/tests") + set (tests_py "${py_src}/../tests/py") -set (py_path $ ${py_bld} $ENV{PATH}) -set (py_pythonpath ${py_tests} ${py_src} ${py_bin} ${tests_py} $ENV{PYTHONPATH}) -to_native_path ("${py_pythonpath}" py_pythonpath) -to_native_path ("${py_path}" py_path) + set (py_path $ ${py_bld} $ENV{PATH}) + set (py_pythonpath ${py_tests} ${py_src} ${py_bin} ${tests_py} $ENV{PYTHONPATH}) + to_native_path ("${py_pythonpath}" py_pythonpath) + to_native_path ("${py_path}" py_path) -if (CMAKE_BUILD_TYPE MATCHES "Coverage") - set (python_coverage_options -m coverage run --parallel-mode) -endif(CMAKE_BUILD_TYPE MATCHES "Coverage") + if (CMAKE_BUILD_TYPE MATCHES "Coverage") +set (python_coverage_options -m coverage run --parallel-mode) + endif(CMAKE_BUILD_TYPE MATCHES "Coverage") -# Create Python virtual environment to run tests -set(pytest_venv "${py_bin}/pytest_env") -# Have to use a conditional here as you can't use generator expressions in OUTPUT or BYPRODUCTS -if (WIN32) - set(py_venv_bin "Scripts") -else() - set(py_venv_bin "bin") -endif() -set(pytest_bin "${pytest_venv}/${py_venv_bin}") -set(pytest_executable "${pytest_bin}/python${CMAKE_EXECUTABLE_SUFFIX}") + # Create Python virtual environment to run tests + set(pytest_venv "${py_bin}/pytest_env") + # Have to use a conditional here as you can't use generator expressions in OUTPUT or BYPRODUCTS + if (WIN32) + set(py_venv_bin "Scripts") + else() + set(py_venv_bin "bin") + endif() + set(pytest_bin "${pytest_venv}/${py_venv_bin}") + set(pytest_executable "${pytest_bin}/python${CMAKE_EXECUTABLE_SUFFIX}") -add_custom_command( - OUTPUT ${pytest_venv}/env.txt - COMMAND ${Python_EXECUTABLE} -m venv ${pytest_venv} - COMMAND ${pytest_executable} -m pip install --disable-pip-version-check cffi - COMMAND ${pytest_executable} -m pip freeze > ${pytest_venv}/env.txt - BYPRODUCTS ${pytest_executable} -) + add_custom_command( +OUTPUT ${pytest_venv}/env.txt +COMMAND ${Python_EXECUTABLE} -m venv ${pytest_venv} +COMMAND ${pytest_executable} -m pip install --disable-pip-version-check cffi +COMMAND ${pytest_executable} -m pip freeze > ${pytest_venv}/env.txt +BYPRODUCTS ${pytest_executable} + ) -# Create c code for cffi extension -add_custom_command( - OUTPUT .timestamp.cproton_ffi - COMMAND ${CMAKE_COMMAND} -E remove -f .timestamp.cproton_ffi - COMMAND ${pytest_executable} ext_build.py - COMMAND ${CMAKE_COMMAND} -E touch .timestamp.cproton_ffi - DEPENDS ${pytest_venv}/env.txt
[qpid-proton] branch main updated: PROTON-2700: Raw connections: Remove deprecated ambiguous use of READ/WRITTEN events
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 7c591e876 PROTON-2700: Raw connections: Remove deprecated ambiguous use of READ/WRITTEN events 7c591e876 is described below commit 7c591e876e23b50cd08b094daa6ab8c2fa31f44e Author: Andrew Stitcher AuthorDate: Mon Jan 30 20:30:56 2023 -0500 PROTON-2700: Raw connections: Remove deprecated ambiguous use of READ/WRITTEN events We added the DRAIN_BUFFERS event several releases ago to signal the application it should take back any buffers still owned by the raw connection when the conneciton is shutting down. It is now time to remove those ambiguous uses of the READ/WRITTEN events. --- c/src/proactor/raw_connection.c | 14 -- c/tests/raw_connection_test.cpp | 22 +- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/c/src/proactor/raw_connection.c b/c/src/proactor/raw_connection.c index fd633a284..3d8b976c6 100644 --- a/c/src/proactor/raw_connection.c +++ b/c/src/proactor/raw_connection.c @@ -701,21 +701,7 @@ pn_event_t *pni_raw_event_next(pn_raw_connection_t *conn) { } conn->disconnect_state = disc_drain_msg; break; - // TODO: We'll leave the read/written events in here for the moment for backward compatibility - // remove them soon (after dispatch uses DRAIN_BUFFER) case disc_drain_msg: -if (conn->rbuffer_first_read) { - pni_raw_put_event(conn, PN_RAW_CONNECTION_READ); -} -conn->disconnect_state = disc_read_msg; -break; - case disc_read_msg: -if (conn->wbuffer_first_written) { - pni_raw_put_event(conn, PN_RAW_CONNECTION_WRITTEN); -} -conn->disconnect_state = disc_written_msg; -break; - case disc_written_msg: pni_raw_put_event(conn, PN_RAW_CONNECTION_DISCONNECTED); conn->disconnectpending = false; conn->disconnect_state = disc_fini; diff --git a/c/tests/raw_connection_test.cpp b/c/tests/raw_connection_test.cpp index 0f31c4910..7378d7541 100644 --- a/c/tests/raw_connection_test.cpp +++ b/c/tests/raw_connection_test.cpp @@ -569,11 +569,9 @@ TEST_CASE("raw connection") { REQUIRE_FALSE(pni_raw_can_read(p)); REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_CLOSED_WRITE); REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_DRAIN_BUFFERS); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_READ); rgiven = pn_raw_connection_take_read_buffers(p, [0], rtaken); REQUIRE(pni_raw_validate(p)); CHECK(rgiven==rtaken); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_WRITTEN); wgiven = pn_raw_connection_take_written_buffers(p, [0], wtaken); REQUIRE(pni_raw_validate(p)); CHECK(wgiven==wtaken); @@ -633,27 +631,9 @@ TEST_CASE("raw connection") { REQUIRE(pni_raw_validate(p)); CHECK(pn_raw_connection_is_write_closed(p)); REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_CLOSED_WRITE); -// TODO: Remove the inapplicable tests when the drain buffers completely replaces read/written -SECTION("Ensure get read/written events before disconnect if not drained") { - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_DRAIN_BUFFERS); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_READ); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_WRITTEN); -} -SECTION("Ensure no read/written events before disconnect if drained") { - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_DRAIN_BUFFERS); - while(pn_raw_connection_take_read_buffers(p, [0], read.size())>0); - while(pn_raw_connection_take_written_buffers(p, [0], written.size())>0); -} -SECTION("Ensure no written events before disconnect if write drained") { - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_DRAIN_BUFFERS); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_READ); - while(pn_raw_connection_take_read_buffers(p, [0], read.size())>0); - while(pn_raw_connection_take_written_buffers(p, [0], written.size())>0); -} -SECTION("Ensure no read events before disconnect if read drained") { +SECTION("Ensure drain buffers event before disconnect if not drained") { REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_DRAIN_BUFFERS); while(pn_raw_connection_take_read_buffers(p, [0], read.size())>0); - REQUIRE(pn_event_type(pni_raw_event_next(p)) == PN_RAW_CONNECTION_WRITTEN);
[qpid-jms] branch 1.x updated: NO-JIRA: add a JDK 20 build to the GHA CI job
This is an automated email from the ASF dual-hosted git repository. robbie pushed a commit to branch 1.x in repository https://gitbox.apache.org/repos/asf/qpid-jms.git The following commit(s) were added to refs/heads/1.x by this push: new d647c369 NO-JIRA: add a JDK 20 build to the GHA CI job d647c369 is described below commit d647c36917d87b5d699a1cc090154181b16bd876 Author: Robbie Gemmell AuthorDate: Wed Mar 29 15:32:37 2023 +0100 NO-JIRA: add a JDK 20 build to the GHA CI job (cherry picked from commit 34b67669e7ec34ac32981117c025ed776e0e8f10) --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f19b2f9a..59653a7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: -java: [ 11, 17 ] +java: [ 11, 17, 20 ] steps: - uses: actions/checkout@v3 - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org
[qpid-jms] branch main updated: NO-JIRA: add a JDK 20 build to the GHA CI job
This is an automated email from the ASF dual-hosted git repository. robbie pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-jms.git The following commit(s) were added to refs/heads/main by this push: new 34b67669 NO-JIRA: add a JDK 20 build to the GHA CI job 34b67669 is described below commit 34b67669e7ec34ac32981117c025ed776e0e8f10 Author: Robbie Gemmell AuthorDate: Wed Mar 29 15:32:37 2023 +0100 NO-JIRA: add a JDK 20 build to the GHA CI job --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f19b2f9a..59653a7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: -java: [ 11, 17 ] +java: [ 11, 17, 20 ] steps: - uses: actions/checkout@v3 - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org
[qpid-proton] branch main updated: PROTON-2699: disable fdlimit test by default
This is an automated email from the ASF dual-hosted git repository. cliffjansen 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 af4382b85 PROTON-2699: disable fdlimit test by default af4382b85 is described below commit af4382b85fac30a5a352fd0057d67a04113f610d Author: Clifford Jansen AuthorDate: Wed Mar 29 23:27:10 2023 -0700 PROTON-2699: disable fdlimit test by default --- c/tests/CMakeLists.txt | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/c/tests/CMakeLists.txt b/c/tests/CMakeLists.txt index 2645ba5f8..83f6e2213 100644 --- a/c/tests/CMakeLists.txt +++ b/c/tests/CMakeLists.txt @@ -115,14 +115,21 @@ if (CMAKE_CXX_COMPILER) set(pypath "${CMAKE_SOURCE_DIR}/tests/py") -# unset TEST_EXE_PREFIX as valgrind does not run successfully when fds are limited -pn_add_test( - UNWRAPPED - NAME c-fdlimit-tests - PREPEND_ENVIRONMENT "PATH=${path}" "PYTHONPATH=${pypath}" "${test_env}" - APPEND_ENVIRONMENT "TEST_EXE_PREFIX=" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/fdlimit.py) +# Disable fdlimit test by default. Flaky throughout its history and implemntations. +# Very useful for proactor development, so keep around. +set(DEFAULT_FDLIMIT OFF) +option(FDLIMIT "Run the fdlimit recovery test" ${DEFAULT_FDLIMIT}) +if (FDLIMIT) + # unset TEST_EXE_PREFIX as valgrind does not run successfully when fds are limited + pn_add_test( +UNWRAPPED +NAME c-fdlimit-tests +PREPEND_ENVIRONMENT "PATH=${path}" "PYTHONPATH=${pypath}" "${test_env}" +APPEND_ENVIRONMENT "TEST_EXE_PREFIX=" +WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/fdlimit.py) +endif() + endif(HAS_PROACTOR) if(HAS_TLS) - To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org