Skip to content
This repository has been archived by the owner on Dec 21, 2019. It is now read-only.

socket: support network IO deadline (#339) #341

Closed
wants to merge 2 commits into from

Conversation

grrtrr
Copy link
Contributor

@grrtrr grrtrr commented Jan 30, 2019

This resolves #339 by setting an r/w timeout for pipe reads/writes
(if present). This allows listening sockets to recover from bad
incoming connections, and also goroutines suffering from broken
connections, to recover.

Gerrit Renker added 2 commits January 30, 2019 11:27
This resolves #339 by setting an r/w timeout for pipe reads/writes
(if present). This allows listening sockets to recover from bad
incoming connections, and also goroutines suffering from broken
connections, to recover.
@grrtrr
Copy link
Contributor Author

grrtrr commented Jan 30, 2019

TestPubSubIPC seems different on Windows, on my Debian 9 system it runs:

=== RUN   TestPubSubIPC
--- PASS: TestPubSubIPC (1.07s)
    common_test.go:589: Address ipc://mangostest20477, 6 Cases
    common_test.go:158: Jan 30 12:32:24.772: Id 0: Got all 0 messages
    common_test.go:158: Jan 30 12:32:24.779: Id 4: Sent all 0 messages
    common_test.go:158: Jan 30 12:32:24.779: Id 3: Sent all 0 messages
    common_test.go:158: Jan 30 12:32:24.779: Id 2: Sent all 0 messages
    common_test.go:158: Jan 30 12:32:24.779: Id 1: Sent all 0 messages
    common_test.go:158: Jan 30 12:32:24.779: Id 5: Sent all 0 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 0: Sent all 7 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 0: Testing complete
    common_test.go:158: Jan 30 12:32:24.829: Id 4: Got all 2 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 3: Got all 2 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 5: Got all 2 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 1: Got all 2 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 1: Testing complete
    common_test.go:158: Jan 30 12:32:24.829: Id 2: Got all 2 messages
    common_test.go:158: Jan 30 12:32:24.829: Id 2: Testing complete
    common_test.go:158: Jan 30 12:32:24.829: Id 3: Testing complete
    common_test.go:158: Jan 30 12:32:24.829: Id 4: Testing complete
    common_test.go:158: Jan 30 12:32:24.829: Id 5: Testing complete

@gdamore
Copy link
Collaborator

gdamore commented Jan 30, 2019

I want to take a completely different approach here. The use of a deadline to workaround the fact that we are doing blocking operations during an accept call isn't really a fix but a bandaid. What we need to do is have the negotiation steps take place on a separate go routine before we add the pipe to the socket.

Unfortunately, this is going to require some rather significant surgery to the plumbing. I hope to get to this soon, but I'm honestly buried in some other stuff in NNG (and $dayjob) at the moment, so it may be a week or more before I get to this.

@grrtrr
Copy link
Contributor Author

grrtrr commented Jan 31, 2019

I appreciate your commitment to ongoing improvement of this software.
The pull request tried to go into a different direction, I will close this for now and sum up the thoughts in the issue; if your time permits within the next weeks, I'd be grateful for feedback.

@grrtrr grrtrr closed this Jan 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NewConnPipe can wait indefinitely on peer
2 participants