-
Notifications
You must be signed in to change notification settings - Fork 840
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
Refactor interfaces and make DNS/TCP/SSL connection setup non-blocking #1002
Refactor interfaces and make DNS/TCP/SSL connection setup non-blocking #1002
Conversation
84eaf7d
to
57180bd
Compare
STATUS UPDATE:
cc @lukebakken |
.travis.yml
Outdated
- nosetests | ||
- PIKA_TEST_TLS=true nosetests | ||
- set +e | ||
#- set +e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are temporary, will be reverted. They help me get a better picture of what is failing.
57180bd
to
158b66e
Compare
FOOD FOR THOUGHT:
|
8e6d9de
to
80bcff0
Compare
UPDATE:
|
@lukebakken, in examining the build/test output log, I noticed the following message about erlang crash at the very end of the log. See in https://travis-ci.org/pika/pika/jobs/356647867, for example:
|
c2d43f3
to
6fc11f5
Compare
d942313
to
b9739e5
Compare
pika/adapters/amqp_connector.py
Outdated
"""Implements the workflow of performing multiple TCP/[SSL]/AMQP connection | ||
attempts with timeouts and retries until one succeeds or all attempts fail. | ||
|
||
The workflow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users have been asking for this for a while. This PR makes it easy to provide such functionality.
b9739e5
to
230f31f
Compare
f1721f2
to
8f85de3
Compare
@vitaly-krugl I'll try to find a nice chunk of time to look at this tomorrow. Thanks! |
I know what you mean :)
…On Thu, Apr 19, 2018, 9:40 PM Luke Bakken ***@***.***> wrote:
@vitaly-krugl <https://github.com/vitaly-krugl> I'll try to find a nice
chunk of time to look at this tomorrow. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1002 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABX9Kqti3ouO3yIx6w3sxwCL5_Nv9GJeks5tqWa6gaJpZM4Sy9uO>
.
|
…ion since BaseConnection concerns itself prinarily with transport manegement while TwistedProtocolConnection has a different transport model.
@lukebakken, I just made a couple of API cleanup changes and rebased Of course, since Review away... :) The changes are in separate commits in case you already started with the review. |
on_done, | ||
ssl_context=None, | ||
server_hostname=None): | ||
"""Perform SSL session establishment, if requested, on the already- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was surprised that a method called create_streaming_connection
is described with "Perform SSL session establishment"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lukebakken, as mentioned at the top of the script in its docstring, I modeled the interface on asyncio. create_streaming_connection()
is a subset of the behavior of asyncio's AbstractEventLoop.create_connection(). The rationale is that a protocol (AMQP connection in our case) needs a stream. The stream might be TCP or SSL/TLS on top of TCP. The protocol doesn't care which one. It's up to the transport to abstract away the differences. Pika's new AbstractIOServices.create_streaming_connection()
takes care of the details, just as the comparable method in asyncio
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple comments, I'm still reviewing. Tests pass on my local machine without any orphaned fd
messages 😄
…onWorkflow to avoid "unclosed socket" warning during travis-ci test run.
…_for_connection_setup()
pika.connection.Connection-based adapter implementation.
b468a9d
to
de43bfe
Compare
@lukebakken, I fixed resource leaks in pika tests. Also, updated README.rst. |
@vitaly-krugl is there any usage examples in |
Yes, good point. I will look through the examples and update the ones that are affected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the TODO
items be taken care of? Other than that, 👍 on this pull request.
@lukebakken, I will follow up on TODOs and @hairyhum's feedback from home. |
…acks in examples to match implementation. Updated on_open_error_callback and on_close_callback connection callbacks documentation.
@lukebakken @hairyhum: I updated the usage examples via commit 8f90e34. |
@lukebakken, regarding
There is nothing pressing about the new TODOs. Just food for thought at this time. If you're happy with the state of things, please go ahead and approve this pull request and we'll get it merged. Thanks! |
Nice work @vitaly-krugl |
@lukebakken, thanks for reviewing - I know it was a job and one half :) |
The expected signatures for these callbacks seem to have changed somewhere in pika/pika#1002. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
The expected signatures for these callbacks seem to have changed somewhere in pika/pika#1002. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
The expected signatures for these callbacks seem to have changed somewhere in pika/pika#1002. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
The expected signatures for these callbacks seem to have changed somewhere in pika/pika#1002. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
The expected signatures for these callbacks seem to have changed somewhere in pika/pika#1002. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
Formalize Asynchronous Services (Event loop + comms) interface between Pika core and adapters
Formalize interface between Pika core and transports
Factor out communications logic into transports and make connection-establishment non-blocking (Plaintext and SSL)
Connection-establishment using multiple connection parameters configs for fault-tolerant implementations
Enable IPv6 testing on travis-ci
Summary of new features:
Summary of backward-incompatible improvements for v1.0.0 target release.
connection.close()
call (beforeon_open_callback
is called), report ConnectionOpenAborted exception viaon_open_error_callback
. Previously,ConnectionClosed
was reported viaon_close_callback
even though the connection opening never completed. I.e., if opening fails or is interrupted for any reason, it's now consistently reported viaon_open_error_callback
.socket.socket
objects, just create a new instance of connection to (re)connect.Other implementation changes:
on_open_error_callback
orthogonal: now always pass exception object (versus formerly exception or string).Also, as consequence of refactoring:
Fixes: #528
Fixes: #647
Fixes: #889
Fixes: #960
Fixes: #970
Fixes: #985