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

refactor dialing to not panic, and to be smart about ordering #1837

Merged
merged 1 commit into from
Oct 16, 2015

Conversation

whyrusleeping
Copy link
Member

After yet another goprocess bug I decided to just rip it out. Its gone now. bye bye.

I also figured that, while I was at it, I would add a bit of priority to the order in which we dial addresses.
First: addresses that dont consume a file descriptor.
Second: localhost addresses, as they should either succeed or fail immediately.
Third: all normal tcp addresses.
Last: dockers '172.17' range of addresses, these are almost always trouble.

License: MIT
Signed-off-by: Jeromy jeromyj@gmail.com

@@ -371,87 +373,84 @@ func (s *Swarm) dialAddrs(ctx context.Context, d *conn.Dialer, p peer.ID, remote
ctx, cancel := context.WithCancel(ctx)
defer cancel() // cancel work when we exit func

foundConn := make(chan struct{})
conns := make(chan conn.Conn, len(remoteAddrs))
conns := make(chan conn.Conn)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this gets buffered, then open connections just sit in the channel and never get closed

@jbenet
Copy link
Member

jbenet commented Oct 14, 2015

weird, not sure why the goproc limiter has a bug. also this is not a goprocess bug it's a goprocess/limiter bug-- it's UX is bad.

(we can change the goprocess interface to not panic on this sort of thing, and instead close the process immediately.)

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
@whyrusleeping
Copy link
Member Author

alright, stripped this PR down to just the panic fix simplification stuff.

@whyrusleeping
Copy link
Member Author

huh, maybe I should fix this one too: https://travis-ci.org/ipfs/go-ipfs/jobs/85398391

Since it decided to fail on this PR of any it could have chosen

@jbenet
Copy link
Member

jbenet commented Oct 16, 2015

@whyrusleeping ok sounds good.

jbenet added a commit that referenced this pull request Oct 16, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
refactor dialing to not panic, and to be smart about ordering
@jbenet jbenet merged commit 4de5eaa into master Oct 16, 2015
@jbenet jbenet removed the status/in-progress In progress label Oct 16, 2015
@jbenet jbenet deleted the dial-smarter branch October 16, 2015 15:47
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

Successfully merging this pull request may close these issues.

None yet

2 participants