Comments (2)
It's not a typo. The aio_pika.Channel
uses the pika.Channel
through pika.Connection
instance. When connection closes the pika.Connection
instance is not created yet and this exception raises.
This behaviour explicit. What behaviour will be fine for you?
from aio-pika.
Thanks. Not sure I fully understand though - I was under the impression that the error gets thrown at re-connection, where RobustChannel
tries to re-init itself. It means that the connection
object passed to on_reconnect()
has not been instantiated, correct?
def on_reconnect(self, connection, channel_number):
exc = ConnectionError('Auto Reconnect Error')
if not self._closing.done():
self._closing.set_exception(exc)
self._closing = create_future(loop=self.loop)
self._futures.reject_all(exc)
self._connection = connection
self._channel_number = channel_number
yield from self.initialize()
for name, exchange in self._exchanges.items():
yield from exchange.on_reconnect(self)
for name, queue in self._queues.items():
yield from queue.on_reconnect(self)
In that case, would it be better to add a check (or await?) on the connection before trying to recreate a channel?
Just to give you some context: I am trying to write an always-running producer that needs to be robust to the fact that (1) rabbitmq might not be available at startup or (2) rabbitmq might become unavailable at any point after startup. I seem to have issues getting it to work as intended (for example, it will reconnect once rabbitmq recovers, but the task won't move on with what it should do).
from aio-pika.
Related Issues (20)
- What is the precise definition of the term "processed"? HOT 2
- Ack and reject outside of IncomingMessage.process() HOT 1
- Quick Start Guide, External Credentials Example. May be incorrect.
- Consumer gets stuck on ack HOT 4
- Deprecation warnings about datetime.utcnow and datetime.utcfromtimestamp
- `QueueIterator` doesn't raise errors when Queue was deleted HOT 1
- Quick Start Guide, Topic Exchange guide code not working as expected
- Publishing Message - NOT_IMPLEMENTED - immediate=true HOT 2
- ChannelInvalidStateError after updating secret and publishing a message HOT 1
- Updating credentials not possible in initial connection loop of robust connection HOT 6
- Server connection xxx was stuck. No frames were received in 183 seconds. HOT 1
- Compatibility with TLSv1.3 HOT 2
- QueueIterator implicit cancellation can be suppressed HOT 1
- How to consume msg by sub coroutine? HOT 1
- Issue with using RobustQueue.consume() in latest version vs 9.0.7 HOT 2
- Potential memory leak - pamqp\base.py HOT 3
- Exceptions in async callbacks in Connection.close_callbacks are ignored
- Messages are NACK'ed multiple times around queue deletion HOT 3
- Unable to use tls protected connection
- Issue recreating connection to a queue after a connection problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aio-pika.