core-lightning/connectd
Rusty Russell 01cd605cb1 connectd: fix missing peer close.
We were getting the following message in test_feerate_stress:

```
2024-07-08T02:15:45.5663941Z lightningd-2 2024-07-08T02:13:45.696Z **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-connectd: Peer did not close, forcing close
```

I can reproduce it locally if I run the test enough, and finally found
the issue by printing the status of the fd when we time it out (using
routines from connectd.c).

The peer fd alternates between reading and writing.  When we go to
discard it, we wake the write queue, so write_to_peer() get called.
It won't shutdown the socket if there are still subds attached, and
will wait again for a read.

The last subd exit has to also wake the write queue if we're draining,
so it can do the io_sock_shutdown.  Otherwise, we hit the timeout,
causing the message above.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2024-07-09 18:03:44 +09:30
..
test common: remove type_to_string files altogther. 2024-03-20 13:51:48 +10:30
connectd.c connectd: don't report socket fds twice. 2024-07-09 18:03:44 +09:30
connectd.h connectd: --dev-handshake-no-reply so we can test pending connections. 2024-05-14 18:16:26 -05:00
connectd_gossipd_wire.csv gossipd: don't hand out fds. 2022-02-08 11:15:52 +10:30
connectd_wire.csv connectd: --dev-handshake-no-reply so we can test pending connections. 2024-05-14 18:16:26 -05:00
gossip_rcvd_filter.c channeld: Code to implement splicing 2023-07-31 21:00:22 +09:30
gossip_rcvd_filter.h channeld: take over gossip_rcvd_filter.c and is_msg_gossip_broadcast. 2022-06-17 14:14:02 +09:30
gossip_store.c connectd: don't suppress channel_announcement without channel_update yet. 2024-02-12 11:43:33 +01:00
gossip_store.h gossipd: remove spam handling. 2024-02-04 09:24:44 +10:30
handshake.c common: remove type_to_string files altogther. 2024-03-20 13:51:48 +10:30
handshake.h connectd: don't try to set TCP_CORK on websocket pipe. 2023-04-10 09:41:56 +09:30
Makefile bolt12: allow first_node_id in blinded path to be a scid. 2024-05-12 19:11:43 -05:00
multiplex.c connectd: fix missing peer close. 2024-07-09 18:03:44 +09:30
multiplex.h connectd: separate routine to inject message without closing connection. 2024-01-31 14:47:33 +10:30
netaddress.c common: remove websocket type from wireaddr. 2023-06-01 09:28:39 +09:30
netaddress.h cleanup: remove unneeded includes in header files. 2021-09-17 09:43:22 +09:30
onion_message.c common: remove type_to_string files altogther. 2024-03-20 13:51:48 +10:30
onion_message.h onionmessages: remove obsolete onion message parsing. 2022-09-29 16:10:57 +09:30
peer_exchange_initmsg.c connectd: --dev-handshake-no-reply so we can test pending connections. 2024-05-14 18:16:26 -05:00
peer_exchange_initmsg.h connectd: don't try to set TCP_CORK on websocket pipe. 2023-04-10 09:41:56 +09:30
sha1.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
sha1.h lightning_websocketd: simple proxy for websockets. 2021-10-22 11:56:30 +02:00
tor.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
tor.h connectd: rename 'struct reaching' to 'struct connecting'. 2018-09-28 04:14:28 +00:00
tor_autoservice.c common/wireaddr.h: simplify parse_wireaddr API. 2023-06-01 09:28:39 +09:30
tor_autoservice.h connectd: remove enable-autotor-v2-mode option 2022-05-18 10:15:36 +09:30
websocketd.c connectd: pass correct buflen to memmem 2023-04-27 07:41:06 +09:30