Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection.close() Been waiting | help me #640

Open
Y7000-save-me opened this issue Jul 26, 2024 · 1 comment
Open

connection.close() Been waiting | help me #640

Y7000-save-me opened this issue Jul 26, 2024 · 1 comment

Comments

@Y7000-save-me
Copy link

async def disconnect(self):
if self.connection and not self.connection.is_closed:
logger.info(f"close RabbitMQ connection1")
try:
await self.connection.close()
logger.info(f"close RabbitMQ connection2")
except Exception as e:
logger.error(f"Failed to close RabbitMQ connection: {e}")

async def on_shutdown():
await rabbit_mq.disconnect()

app.add_event_handler("shutdown", on_shutdown)

log
INFO: Shutting down
INFO: Waiting for application shutdown.
2024-07-26 16:42:28.703 | INFO | agentic.base.mq.client:disconnect:52 - close RabbitMQ connection1

The connection won't shut down

@antonparshukov00
Copy link

Version: aio-pika 9.4.1
Faced same/similar problem. Code is waiting forever on the closing. Will try to explore more.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants