Skip to content

Thread hangs in disconnect_socket #951

Closed
@devrandom

Description

@devrandom

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions