Comments (4)
A client connection can be closed cleanly or abnormally. In the former case the client closes AMQP 0-9-1 (or 1.0, or STOMP, or MQTT) connection gracefully using a dedicated library function (method). In the latter case the client closes TCP connection or TCP connection fails. RabbitMQ will log both cases.
according to the docs of rabbitmq, it seems AmqpProtocol just simply close the underlying socket connection, without sending a proper close signal(?) to rabbitmq first.
Abruptly closed connections can be harmless.
althrough, i think implemeting the "normal close" is still good to have.
from trio-amqp.
I agree and it should close cleanly (when not crashing). I'll look into it (though it'll be a couple weeks before I can get to it). Pull requests welcome. ;-)
from trio-amqp.
according to the amqp 0-9-1 reference, there is a connection.close()
command which corresponding to pamqp.commands.Connection.Close()
.
after dived into the code, and i think it could be caused by the following code:
Protocol.close():
# see: https://github.com/python-trio/trio-amqp/blob/dd805fc93e668b4ae094609d4afefa4561e64ae4/async_amqp/protocol.py#L228
await self.connection_closed.set()
if not got_close:
# ...
# see: https://github.com/python-trio/trio-amqp/blob/dd805fc93e668b4ae094609d4afefa4561e64ae4/async_amqp/protocol.py#L248
await self.wait_closed()
# which simply call `self.connection_closed.wait()`
since connection_closed is always set before waiting, the later wait() does not work as expected.
from trio-amqp.
Related Issues (11)
- This socket was already closed HOT 3
- trio.TrioDeprecationWarning: trio.hazmat is deprecated; use trio.lowlevel HOT 1
- Updates needed for recent trio versions (0.17.0 current as of this writing) HOT 1
- the signature of callbacks for channel.basic_consume() in examples/ are outdated
- PyPI/GitHub mismatch (missing code for release 0.5.0)
- Default branch HOT 1
- SyntaxError: 'yield' inside async function HOT 4
- Any plan to support amqp1-0-0? HOT 2
- New release for pip install? HOT 9
- Project status HOT 2
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 trio-amqp.