🐛 Fix RabbitMQ probe cleanup on Python 3.14#7342
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7342 +/- ##
==========================================
+ Coverage 80.23% 80.25% +0.02%
==========================================
Files 577 577
Lines 45478 45502 +24
==========================================
+ Hits 36487 36515 +28
+ Misses 8991 8987 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
25fcc1e to
1039c2d
Compare
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
1039c2d to
bd1390e
Compare
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings.
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options.
bd1390e to
5229304
Compare
GeigerJ2
left a comment
There was a problem hiding this comment.
OK, only one very nitpicky comment. Apart from that, you have pleased the pedantic review agent. Good job!
| @@ -40,8 +86,6 @@ def detect_rabbitmq_config( | |||
| :raises ConnectionError: If the connection failed with the provided connection parameters | |||
| :returns: The connection parameters if the RabbitMQ server was successfully connected to, or ``None`` otherwise. | |||
There was a problem hiding this comment.
Pre-existing, but since the PR modifies this function: the docstring says "or None otherwise" but the function never returns None. It raises ConnectionError on failure (which all three callers — cmd_presto.py:242, cmd_profile.py:85, cmd_profile.py:174 — explicitly catch). The return type annotation -> dict[str, t.Any] is correct. Suggested fix:
:returns: The connection parameters with keys prefixed with ``broker_``.Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings.
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options.
5229304 to
1a409af
Compare
| @@ -40,8 +86,6 @@ def detect_rabbitmq_config( | |||
| :raises ConnectionError: If the connection failed with the provided connection parameters | |||
| :returns: The connection parameters if the RabbitMQ server was successfully connected to, or ``None`` otherwise. | |||
There was a problem hiding this comment.
| :returns: The connection parameters if the RabbitMQ server was successfully connected to, or ``None`` otherwise. | |
| :returns: The connection parameters with keys prefixed with ``broker_``. |
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings.
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options.
1a409af to
5539fd5
Compare
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings.
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options.
5539fd5 to
c5f7af2
Compare
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
c5f7af2 to
0271f90
Compare
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails. This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.__del__ when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker. Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Temporarily raise the aiormq and aio-pika logger levels while probing RabbitMQ connection parameters. The failed probe path is expected during verdi presto fallback, so the transport creation error should not be shown before the CLI reports that it is switching to the ZMQ broker. Extend the subprocess regression test to verify that the noisy transport log is no longer emitted alongside the Python 3.14 cleanup warnings. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Move aio_pika imports from module level into _probe_rabbitmq_connection() to avoid loading aio_pika on every verdi invocation, since BROKER_DEFAULTS is imported at module level by CLI options. Reviewed-by: Julian Geiger <julian.geiger@psi.ch>
Should fix issues when trying to connect to RMQ. This fix is not related to ZMQ but the problem became more pressing because in verdi presto we first try to connect to RMQ and if its not available
First commit fixes the
RobustConnection.close. Second commit surpresses theerror when creating transport: <AMQPConnectionError: (61, "Connect call failed ('127.0.0.1', 5672)")>This PR replaces probably PR #7328 but need to verify.
Probe RabbitMQ connection parameters in an isolated event loop and close the temporary aio-pika connection explicitly, even when the connection attempt fails.
This avoids the Python 3.14 cleanup warning emitted by aio-pika's Connection.del when verdi presto falls back from a failed RabbitMQ probe to the ZMQ broker.
Add regression coverage for the failed probe path and verify that it no longer emits the ignored deallocator exception or unawaited coroutine warning.