connectd: fix diagnostics if we get a long delay.
In a0fd72eb5e I added a diagnostic message if messages cause large
delays, *but* I didn't set the "peer_in_lasttime" variable in the case
of locally-handled packets.
I really want this in the release: the point of this was to try to
diagnose some high-latency ping issues we've seen on the real network.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1093,6 +1093,7 @@ static struct io_plan *write_to_peer(struct io_conn *peer_conn,
|
||||
if (!msg) {
|
||||
/* Tell them to read again, */
|
||||
io_wake(&peer->subds);
|
||||
io_wake(&peer->peer_in);
|
||||
|
||||
/* Wait for them to wake us */
|
||||
return msg_queue_wait(peer_conn, peer->peer_outq,
|
||||
@@ -1266,8 +1267,11 @@ static struct io_plan *read_body_from_peer_done(struct io_conn *peer_conn,
|
||||
return next_read(peer_conn, peer);
|
||||
|
||||
/* If we swallow this, just try again. */
|
||||
if (handle_message_locally(peer, decrypted))
|
||||
return next_read(peer_conn, peer);
|
||||
if (handle_message_locally(peer, decrypted)) {
|
||||
/* Make sure to update peer->peer_in_lastmsg so we blame correct msg! */
|
||||
io_wake(peer->peer_outq);
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* After this we should be able to match to subd by channel_id */
|
||||
if (!extract_channel_id(decrypted, &channel_id)) {
|
||||
@@ -1334,6 +1338,7 @@ static struct io_plan *read_body_from_peer_done(struct io_conn *peer_conn,
|
||||
|
||||
/* Wait for them to wake us */
|
||||
peer->peer_in_lastmsg = type;
|
||||
out:
|
||||
peer->peer_in_lasttime = time_mono();
|
||||
|
||||
return io_wait(peer_conn, &peer->peer_in, next_read, peer);
|
||||
|
||||
Reference in New Issue
Block a user