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

fix: shutdown the tcpstream when we initiate to close a peer connection #2288

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

garyyu
Copy link
Contributor

@garyyu garyyu commented Jan 4, 2019

Based on #2287 's a test log, perhaps I find one leaking point for peer connections:

20190104 05:15:29.510 DEBUG grin_p2p::peer - Send tx kernel hash 133cc0ab to 47.99.92.164:13414
20190104 05:15:33.058 DEBUG grin_p2p::peer - Client 47.99.92.164:13414 connection lost: Connection(Custom { kind: ConnectionAborted, error: StringError("read_exact") })
20190104 05:15:50.546 DEBUG grin_p2p::peers - clean_peers V4(47.99.92.164:13414), not connected
20190104 05:22:28.466 DEBUG grin_p2p::serv - clean_lost_sockets - close a lost open socket: 47.99.92.164:58462, not in peers list

that means when we quit the peer polling thread, we forgot to close the socket:

	// check the close channel
	if let Ok(_) = close_rx.try_recv() {
		debug!(
			"Connection close with {} initiated by us",
			...
		);
		break;    <<<< problem here!  we just quit without a real close!
	}

@garyyu garyyu added the bug label Jan 4, 2019
@ignopeverell ignopeverell merged commit 6165c08 into mimblewimble:master Jan 4, 2019
@garyyu garyyu deleted the close branch January 5, 2019 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants