Skip to content

Thread hangs in disconnect_socket #951

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

Closed
devrandom opened this issue Jun 13, 2021 · 2 comments
Closed

Thread hangs in disconnect_socket #951

devrandom opened this issue Jun 13, 2021 · 2 comments

Comments

@devrandom
Copy link
Member

devrandom commented Jun 13, 2021

Sometimes we get stuck in a busy loop here:

        while self.conn.lock().unwrap().block_disconnect_socket {
	        thread::yield_now();
        }

I think this is caused by one of the two places that has the following structure:

	if let Err(e) = peer_manager.write_buffer_space_avail(&mut our_descriptor) {
		shutdown_socket!(e, Disconnect::CloseConnection);
	}
	us.lock().unwrap().block_disconnect_socket = false;

since shutdown_socket! jumps out of the surrounding loop.

The last log entry was:

2021-06-13 17:01:03 TRACE [lightning::ln::peer_handler:1370] Disconnecting peer with id 03cef01527340b029e2b4a6293b98190e4e51b7c07b5e49b6412a7d4edd3b0d03d due to ping timeout

@devrandom
Copy link
Member Author

I can sometimes replicate this by pausing a node in the debugger and restarting it after the ping timeout.

@TheBlueMatt
Copy link
Collaborator

Fixed by #957. If there's more left let's open a new issue.

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

No branches or pull requests

2 participants