Skip to content

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

Merged
ignopeverell merged 1 commit intomimblewimble:masterfrom
garyyu:close
Jan 4, 2019
Merged

fix: shutdown the tcpstream when we initiate to close a peer connection#2288
ignopeverell merged 1 commit intomimblewimble:masterfrom
garyyu:close

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