mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
55c1e311bf
Our low-level ccan/io IO routines return three values: -1: error. 0: call me again, I'm not finished. 1: I'm done, go onto the next thing. In the last release, we tweaked the sematics of "-1": we now opportunistically call a routine which returns 0 once more, in case there's more data. We use errno to distinguish between "EAGAIN" which means there wasn't any data, and real errors. However, if the underlying read() returns 0 (which it does when the peer has closed the other end) the value of errno is UNDEFINED. If it happens to be EAGAIN, we will call it again, rather than closing. This causes us to spin: in particular people reported hsmd consuming 100% of CPU. The ccan/io read code handled this by setting errno to 0 in this case, but our own wire low-level routines *did not*. Fixes: https://github.com/ElementsProject/lightning/issues/7655 Changelog-Fixed: Fixed intermittant bug where hsmd (particularly, but also lightningd) could use 100% CPU. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> |
||
---|---|---|
.. | ||
test | ||
bolt12_wire.csv | ||
channel_type_wire.csv | ||
extracted_bolt12_01_recurrence.patch | ||
extracted_onion_02_offers.patch | ||
extracted_onion_03_onionmsg-payload-as-bytearr.patch | ||
extracted_onion_05_remove-onion_message.patch | ||
extracted_peer_04_opt_will_fund.patch | ||
extracted_peer_05_newonion.patch | ||
extracted_peer_06_funding_outpoint_sigs.patch | ||
extracted_peer_07_peer_storage.patch | ||
extracted_peer_09_quiescence-protocol.patch | ||
extracted_peer_10_upgradable.patch | ||
extracted_peer_11_splice.patch | ||
extracted_peer-shutdown-wrong_funding.patch | ||
fromwire.c | ||
Makefile | ||
onion_defs.h | ||
onion_wire.csv | ||
onion_wire.h | ||
peer_wire.c | ||
peer_wire.csv | ||
peer_wire.h | ||
tlvstream.c | ||
tlvstream.h | ||
towire.c | ||
wire_io.c | ||
wire_io.h | ||
wire_sync.c | ||
wire_sync.h | ||
wire.h |