-
Notifications
You must be signed in to change notification settings - Fork 962
connectd: Update connection list with new address #4192
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
Conversation
rustyrussell
left a comment
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.
Needs some pycheck fixes, and Travis is grumpy...
tests/plugins/slow_start.py
Outdated
| @plugin.async_method('waitconn') | ||
| def wait_connection(request, plugin): | ||
| sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
| addr = ('localhost', 6669) |
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.
Use port number 0, which will assign an unused ephemeral port? Then use getsockname and print out what port you got.
This avoids conflicts on port 6669.
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.
nice, updated.
cdecker
left a comment
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.
The Travis failure might just be a timeout that is a bit optimistic in the .result(1) calls below. I'm wondering though why the decoy port is managed in a plugin at all, since the creation of the listening socket and acceptance of the connection could just as well be done in the test itself.
Needs signaling between the listening socket and the main test thread. By using a plugin we can take advantage of Open to different ideas for how to do inter-thread signaling on python. /me eyes Golang channels. |
13792a4 to
a8b1a38
Compare
Ah yes, inter-thread / inter-process communication :-) But no need to amend, I was just curious as to why the big hammer was used in this case :-) |
I can't take credit for the idea, @rustyrussell suggested it first lol. |
|
Seems Travis doesn't like the change just yet. Failing tests are:
The stresstest one seems to be a crash here: So likely just a null-pointer somewhere in |
If we're already attempting to connect to a peer, we would ignore new connection requests. This is problematic if your node has bad connection details for the node -- you can't update it while inflight. This patch appends new connection suggestions to the list of connections to try. Fixes ElementsProject#4154
|
So I'm a bit confused by this crash. Line 288 of Except that, we shouldn't be calling Update: the connection associated with the |
Coauthored-By: Rusty Russell @rustyrussell
a8b1a38 to
6491961
Compare
rustyrussell
left a comment
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.
Ack 6491961
Nice catch of long-outstanding race between incoming and outgoing conns!
If we're already attempting to connect to a peer, we would ignore
new connection requests. This is problematic if your node has bad
connection details for the node -- you can't update it while inflight.
This patch appends new connection suggestions to the list of connections
to try.
Fixes #4154
Changelog-None